![]() |
yumapro
21.10T-10
YumaPro SDK
|
JSON Output Functions. More...
![]() |
Functions | |
status_t | agt_json_parse_top_identifier (ses_cb_t *scb, xml_msg_hdr_t *msg, obj_template_t *obj, const xmlChar **modname, const xmlChar **name, xmlChar **tempbuff) |
Parse a top-level JSON object;. More... | |
status_t | agt_json_parse_text (ses_cb_t *scb, xml_msg_hdr_t *msg, obj_template_t *obj, dlq_hdr_t *returnQ) |
Parse token chain representing JSON Text. More... | |
JSON Output Functions.
Uses NCX JSON APIs to output JSON to a RESTCONF session
status_t agt_json_parse_text | ( | ses_cb_t * | scb, |
xml_msg_hdr_t * | msg, | ||
obj_template_t * | obj, | ||
dlq_hdr_t * | returnQ | ||
) |
Parse token chain representing JSON Text.
Makes sure that only allowed value strings or child nodes (and their values) are entered.
Defaults are not added to any objects Missing objects are not checked
A seperate parsing phase is used to fully validate the input contained in the returned val_value_t struct.
This parsing phase checks that simple types are complete and child members of complex types are valid (but maybe missing or incomplete child nodes).
scb | session control block |
msg | incoming RPC message |
obj | obj_template_t for the object to parse |
returnQ | address of Q to store parsed value results |
returnQ | has 1 or more malloced val_value_t representing the parsed value(s) |
msg->errQ | may be appended with new errors |
status_t agt_json_parse_top_identifier | ( | ses_cb_t * | scb, |
xml_msg_hdr_t * | msg, | ||
obj_template_t * | obj, | ||
const xmlChar ** | modname, | ||
const xmlChar ** | name, | ||
xmlChar ** | tempbuff | ||
) |
Parse a top-level JSON object;.
will be used only for the DATASTORE launchpoint in order to set request_target and obj
scb | session control block Input is read from scb->reader. |
msg | incoming RPC message Errors are appended to msg->errQ |
obj | object template to use for parsing |
modname | address of return module name, may be NULL |
name | address of return name of the node |
tempbuff | address of return buffer pointer |
*modname | module name of the node |
*name | name of the identifier |
*tempbuff | malloced buffer to write, must be freed by caller |