I have been trying to use the same example as is; assuming that apache was also utilizing mJSON.
However, it seems there are quite some differences from that library. For e.g. .addr.integer = PRN is no longer valid. It is now .arr.integers.store = PRN And json_read_object requires a struct json_buffer *jb instead of a char array. This struct has to be populated using user method etc. There are multiple differences from the MicroJSON implementation. Isn’t there some good documentation on this ? > On 28-Feb-2018, at 10:39 PM, Christopher Collins <ch...@runtime.io> wrote: > > Hi Aditya, > > On Wed, Feb 28, 2018 at 06:35:04PM +0530, Aditya Xavier wrote: >> Thanks got Encoding working for the required JSON. >> >> Any pointers on how to get the decoding working ? >> >> From the example >> https://github.com/apache/mynewt-core/blob/master/encoding/json/test/src/testcases/json_simple_decode.c >> >> <https://github.com/apache/mynewt-core/blob/master/encoding/json/test/src/testcases/json_simple_decode.c> >> >> Am able to decode upto name2 only. >> >> {“name1": 1,”name2": “value2”, “name3”: [{“name4”: 2, “name5”: 3}]}; >> >> Please let me know the Structure for Array of objects. > > Example 2 in the microjson document > (http://www.catb.org/~esr/microjson/microjson.html) does something > similar, so I would take a look at that. This example is under the > "Compound Value Types" heading. > > Chris