-
Notifications
You must be signed in to change notification settings - Fork 2
JSON_PRESENT
Jurek Muszyński edited this page Dec 19, 2021
·
3 revisions
Checks the field's presence in JSON object.
true if the field is present, otherwise false.
JSON req={0};
if ( !REQ_DATA )
{
OUT("<p>Payload is required.</p>");
return false;
}
if ( !JSON_FROM_STRING(&req, REQ_DATA) )
{
OUT("<p>Payload is not a valid JSON.</p>");
return false;
}
if ( !JSON_PRESENT(&req, "description") )
{
OUT("<p>Description is required in payload.</p>");
return false;
}