onappid: retrieves the 'appid' with id field 49/18149/1 6.99.1 guppy/6.99.1 guppy_6.99.1
authorClément Bénier <clement.benier@iot.bzh>
Wed, 21 Nov 2018 17:31:51 +0000 (18:31 +0100)
committerClément Bénier <clement.benier@iot.bzh>
Wed, 21 Nov 2018 17:36:06 +0000 (18:36 +0100)
the value of id field shoud be a string not an integer
so {si} is replaced by {ss}

Change-Id: Ief8a1e56295085cfe818301fd0073399a3ae6315
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
src/afm-binding.c

index 037c108..f4bba8a 100644 (file)
@@ -244,7 +244,7 @@ static int onappid(afb_req_t req, const char *method, const char **appid)
 
        /* get the appid if any */
        if (!wrap_json_unpack(json, "s", appid)
-        || !wrap_json_unpack(json, "{si}", _id_, appid)) {
+        || !wrap_json_unpack(json, "{ss}", _id_, appid)) {
                /* found */
                INFO("method %s called for %s", method, *appid);
                return 1;