Check that JSON data matches the structure your application expects
Valid JSON syntax only means the document can be parsed. An application may also require specific fields, value types, formats, or nested structures. Use a JSON Schema to check the actual data against those expectations before sending it to another system.
A practical review process
- Provide the JSON data and the schema that describes the structure it should follow.
- Run validation and inspect the first reported path or field. Missing required properties, incorrect types, and format mismatches usually need different fixes.
- Correct the data or schema according to the intended contract, then validate again with representative examples—not just one successful sample.
Decide whether the data or the schema needs changing
If a required property is missing, first confirm whether the field really must be present. If a number is reported as a string, check whether the source data is wrong or whether the schema describes the field incorrectly. Do not loosen the schema just to make an error disappear if the application genuinely depends on that rule.
The validator checks the supplied data against the supplied schema; it cannot know whether the schema reflects your application's real requirements. Check the expected schema version and supported keywords, and keep a known-good sample so future changes can be compared.
Frequently asked questions
Does a clean report guarantee the data or query is correct?
No. The checks help find likely problems, but you still need to verify results against the requirements of the application and the data itself.
Should I keep an unchanged copy?
Yes. Keep the original file or script until the reviewed result has been checked and accepted in the intended workflow.