Discussions relating to the ScottKlement.com port of the open source YAJL JSON Reader/Generator. This includes the YAJL tool as well as the YAJLR4, YAJLGEN, YAJLINTO and YAJLDTAGEN add-ons from ScottKlement.com. http://www.scottklement.com/yajl/
I have successfully used HTTPAPI in concert with both data-into and YAJL to read a JSON response. I'm very perplexed as how to read a response that looks like the following.
It's an array that has no name. So I don't see how I could use data-into (with a YAJL parser) since a matching data structure needs a name. If I use YAJL there won't be a docNode to do a YAJL_ARRAY_LOOP.
Off the top of my head this would simply require targeting a DS array with DATA-INTO. I think the RPG will accept any name at the top level but since I’m just doing this on my phone I can’t look it up. Also if that doesn’t work I’m pretty sure YAJLINTO provides a way to name the root ele,ent. It is an option that Scott covers in his presentation.
Thanks jonboy... I'll keep experimenting with data-into by just giving it a name. I've reviewed several of Scott's presentations on YAJL but I don't recall seeing anything about naming the root. I'll keep looking. If I find a solution, I'll follow up with a post on what worked.
In case you are stuck I found time to play and see if my understanding was correct. Here's my version which handles your noname array just fine. RPG fills in the element count in the PSDS with the number of DS array entries, Similalrly I used countprefix to name the count for the inner array. This way allowmissing is not needed.
Oh wow. I never would have thought the PSDS would come into play. This prompted me to actually read the documentation. lol.. Sure enough there she blows. I will test it out and see. Thanks so much!