yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches

JSON Output Functions. More...

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
[in,out]msgincoming RPC message
msg->errQ may be appended with new errors
objobj_template_t for the object to parse
[out]returnQaddress of Q to store parsed value results
returnQ has 1 or more malloced val_value_t representing the parsed value(s)
Returns
return status
Here is the call graph for this function:

◆ 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
[out]modnameaddress of return module name, may be NULL
*modname module name of the node
[out]nameaddress of return name of the node
*name name of the identifier
[out]tempbuffaddress of return buffer pointer *tempbuff malloced buffer to write, must be freed by caller
Returns
return status
Here is the call graph for this function: