Before I begin writing plenty of code, I figured I’d try to get some insight on if I should even try to use DATA-INTO in the case presented below.
I’m not sure if DATA-INTO can handle the JSON I might be presented with. It seems I will need to use both allowmissing=yes and allowextra=yes at the same time. I haven’t tried this yet. Also, it is possible I may receive empty objects in a response and other times it’s populated.
A portion of the JSON response looks like the following:
Code: Select all
	"surchargeOptions": {
            "surchargeOption": [
              {
                "label": {
                  "enUsLabel": "string",
                  "frCaLabel": "string"
                },
                "value": "string",
                "key": "key",
                "type": "type",
                "description": "desc",
                "surchargeAmount": 0,
                "editable": false,
                "mandatory": false
              }
            ]
          },
	"coverageOptions": {
            "coverageOption": [
              {}
            ]
          },
	etc, etc, etc
I’m pretty sure YAJL procedures will handle all of this, but that sure is plenty hardcoding of field names versus simple maintenance to a data structure to accommodate any vendor changes in the future.
Hoping I could get some insight here before I begin. Thoughts anyone?