How do you tell the difference between invalid JSON syntax and a schema mismatch?
Validate the JSON syntax first if needed, then run the payload against a schema and inspect which required fields, types, or structural rules failed.
When schema validation matters
Schema validation is the right tool when JSON already parses but still fails an API contract, config requirement, or downstream validation step.
It catches problems such as missing required fields, wrong value types, unexpected properties, and array shape mismatches.
Fast workflow
- 1Paste the JSON instance into a schema validator.
- 2Paste the JSON Schema into the schema editor.
- 3Run validation and inspect whether the payload matches or fails the schema rules.
- 4Fix the failing fields or schema rules, then validate again.
Simple schema example
This schema says the payload must be an object with a string service name, a boolean enabled flag, and an array of integer ports.
Example failing payload
This payload is valid JSON syntax, but it still fails the schema because enabled is a string and ports contains a string instead of only integers.
What failing rules usually mean
- A required-field failure usually means the payload is missing a key the contract expects.
- A type failure usually means a number, boolean, array, or object came through in the wrong shape.
- An additionalProperties failure usually means the payload contains keys that are not part of the documented contract.
No Schema Yet?
Generate a starter schema first
Use the schema generator when you have a representative payload but need a first-pass schema before you validate against it.
Generate a starter schema firstQuick answers
What to do next
Start with the right tool now, then move back to the hub or sideways into the adjacent guides if the first answer was not the whole fix.
Open JSON Schema Validator
Validate a JSON instance against a schema and inspect the exact rules that failed.
Open JSON Schema Generator
Generate a starter schema first when you have a sample payload but no schema yet.
How to Validate JSON
Use a JSON validator to check syntax, read parse errors, and locate the exact line and column causing invalid JSON.
How to Generate JSON Schema
Learn how to generate a starter JSON Schema from a sample payload, what the generator can infer, and what you still need to review manually.