yumapro  20.10-13
YumaPro SDK
Collaboration diagram for JSON:

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...
 

Detailed Description

JSON Output Functions. Uses NCX JSON APIs to output JSON to a RESTCONF session

Function Documentation

◆ agt_json_parse_text()

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).

Parameters
scbsession control block
msgincoming RPC message
objobj_template_t for the object to parse
returnQaddress of Q to store parsed value results
Return values
returnQhas 1 or more malloced val_value_t representing the parsed value(s)
msg->errQmay be appended with new errors
Returns
return status

◆ agt_json_parse_top_identifier()

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

Parameters
scbsession control block
Input is read from scb->reader.
msgincoming RPC message
Errors are appended to msg->errQ
objobject template to use for parsing
modnameaddress of return module name, may be NULL
nameaddress of return name of the node
tempbuffaddress of return buffer pointer
Return values
*modnamemodule name of the node
*namename of the identifier
*tempbuffmalloced buffer to write, must be freed by caller
Returns
return status
Here is the call graph for this function: