YAJL
Posted: Thu Mar 03, 2022 1:59 pm
I'm using the YAJL with OS 7.1 to do Json and it works great but I have this situation where a request for a Json format doesn't require using YAJL_BeginArray section each record process is it's own json record. I tried to use yajl.biginObj, yajl.addChar, yajl.savebuf for multiple reads but only got the first set of data to write to the IFS and get this error - "do_genValue: received YAJL generator status 4 for type code 1". I'm not sure how to code it with YAJL
Here is an example: each record starts with meta
{"meta":{"dataDomain":"Store"},"data":{"batchId":"0050568295f01edaad868fc74a390608","dataType":"store","action":"CreateOrUpdate","retailLocationData":{"retailLocationDataType":"RetailLocation","retailLocationId":"1000","translations":{"en":{"name":"APTOS STORE #0"}},"address":{"addressLine1":"16611 CABOT DR STE A","city":"CURTIS BAY","stateOrProvince":"MD","postalCode":"21226-1766","countryCode":"USA"},"phoneNumbers":[{"phoneNumber":"(510)555-2468","typeCode":"business"}],"currencyCode":"USD","primaryLanguage":"en-US","taxZoneId":"2000","active":true}}}
{"meta":{"dataDomain":"Store"},"data":{"batchId":"0050568295f01edaad868fc74a390608","dataType":"store","action":"CreateOrUpdate","retailLocationData":{"retailLocationDataType":"RetailLocation","retailLocationId":"1001","translations":{"en":{"name":"APTOS STORE #1"}},"address":{"addressLine1":"1450 PREMIUM OUTLETS BLVD","city":"HAGERSTOWN","stateOrProvince":"MD","postalCode":"21740-9524","countryCode":"USA"},"phoneNumbers":[{"phoneNumber":"(301)666-2812","typeCode":"business"}],"currencyCode":"USD","primaryLanguage":"en-US","taxZoneId":"2001","active":true}}}
Here is an example: each record starts with meta
{"meta":{"dataDomain":"Store"},"data":{"batchId":"0050568295f01edaad868fc74a390608","dataType":"store","action":"CreateOrUpdate","retailLocationData":{"retailLocationDataType":"RetailLocation","retailLocationId":"1000","translations":{"en":{"name":"APTOS STORE #0"}},"address":{"addressLine1":"16611 CABOT DR STE A","city":"CURTIS BAY","stateOrProvince":"MD","postalCode":"21226-1766","countryCode":"USA"},"phoneNumbers":[{"phoneNumber":"(510)555-2468","typeCode":"business"}],"currencyCode":"USD","primaryLanguage":"en-US","taxZoneId":"2000","active":true}}}
{"meta":{"dataDomain":"Store"},"data":{"batchId":"0050568295f01edaad868fc74a390608","dataType":"store","action":"CreateOrUpdate","retailLocationData":{"retailLocationDataType":"RetailLocation","retailLocationId":"1001","translations":{"en":{"name":"APTOS STORE #1"}},"address":{"addressLine1":"1450 PREMIUM OUTLETS BLVD","city":"HAGERSTOWN","stateOrProvince":"MD","postalCode":"21740-9524","countryCode":"USA"},"phoneNumbers":[{"phoneNumber":"(301)666-2812","typeCode":"business"}],"currencyCode":"USD","primaryLanguage":"en-US","taxZoneId":"2001","active":true}}}