Parsing a Field Value
  • 21 Nov 2022
  • Dark
    Light
  • PDF

Parsing a Field Value

  • Dark
    Light
  • PDF

Article summary

By using the parse flag in the schema, you can get a response like the one below where some of the data is stringified within the response. The individual fields will be parsed as well, so that they are returned as JSON.

Example: Request Token Schema with Parse

  "$id": "reqTokenSchema.json",
  "properties": {
    ….
    "Data": {
      "type": "object",
      "properties": {
        "Data": {
          "type": "string",
          "parse": true,
          "external_name": "Data"
        }
      },
      "external_name": "Data"
    }     ….
  },
  "definitions": {}
}

RESPONSE IF PARSE NOT TRUE

{
  "ResponseType": "SUCCESS",
  "Data": {
    "Message": "",
    "MessageType": "Success",
    "returnStatus": false,
    "RecordCount": 0,
    "Data": "[{\"siteid\":\"XXXXX\",\"ng_rtr_pair_nm\":\"XXXXXXX\",\"ngmadrtr_id1\":\"XXXXXX\",\"ngmadrtr_id2\":\"XXXXXX\",\"ng_rtr_port\":\"2/1/5\",\"eth_term_mso\":\"XXXXX\"}]"
  }

RESPONSE IF PARSE TRUE

{
  "ResponseType": "SUCCESS",
  "Data": {
    "Message": "",
    "MessageType": "Success",
    "returnStatus": false,
    "RecordCount": 0,
    "Data": [
      {
        "siteid": "XXXXX",
        "ng_rtr_pair_nm": "XXXXXXX", 
        "ngmadrtr_id1": "XXXXXX", 
        "ngmadrtr_id2": "XXXXXX", 
        "ng_rtr_port": "2/1/5",
        "eth_term_mso": "XXXXX"
      }
    ]
  }

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.