z/TPF

z/TPF

z/TPF

The z/TPF group is dedicated to sharing news, knowledge, and insights about the z/TPF product family. Consisting of IBMers and users, this community collaborates to advance the potential of high-volume, high-throughput transaction technology.

 View Only

Array support for JSON root values (PJ48212)

By Bradd Kadlecik posted 7 days ago

  

A JSON document root value can be either an object or an array.  If the JSON document is an object (has a root value of object), then it starts with the begin-object character ({).  If the JSON document is an array (has a root value of array), then it starts with the begin-array character ([). The JSON parser on z/TPF required JSON documents to start with the begin-object character so all JSON documents must represent an object. Since the DFDL parser and REST support uses the JSON parser, DFDL and REST support did not allow JSON documents that start with the begin-array character either.

With PJ48212, JSON documents can begin with either the begin-object or begin-array character.  The JSON parser, DFDL parser, and REST support have all been updated to allow JSON documents that have a root value of array.  The JSON parser is updated to use a document root node of "$" to represent the JSON document root value.  This change does not affect any users of the JSON parser functions (tpf_doc*).  The DFDL parser is updated to allow a new TPF_DFDL_JROOT option to specify which DFDL element corresponds to the JSON document root value during DFDL serialization. The z/TPF OpenAPI code generation utility (tpfrestgen) is updated to create C structures and DFDL schemas that support a JSON array body.

For more information see the APEDIT.

0 comments
1 view

Permalink