An example often becomes someone else’s first test fixture. If it says "published": "yes" while the API returns a boolean, a small documentation error can spread into client code. Compare the JSON value and the schema side by side before publication.
Start with a response a reader could recognize
Load the release response in the JSON Schema validator. The fictional record uses a stable-looking identifier, a human-readable title, and a boolean publication flag. Unicode text belongs in real examples too; it should survive copying and validation.
{
"id": "rel_42",
"title": "Unicode search — now available",
"published": true
}
Use a schema within the supported subset
The schema below checks the object type, three required properties, the property types, a non-empty title, and unexpected properties. It deliberately omits reference and composition features.
{
"type": "object",
"required": ["id", "title", "published"],
"properties": {
"id": {"type": "string"},
"title": {"type": "string", "minLength": 1},
"published": {"type": "boolean"}
},
"additionalProperties": false
}
Run validation with the matching response. The result should contain valid: true and an empty error list. Then load the “String instead of boolean” example and run again. The response remains valid JSON, but it no longer satisfies the schema.
Use the error to decide what needs to change
- Read the instance path in each reported error. It identifies the data location involved in the failed constraint.
- Read the keyword. A
typefailure is different from a missingrequiredproperty or anadditionalPropertiesfailure. - Compare the example with the actual API contract. Correct the example when the example is wrong; correct the schema only when the documented contract is wrong.
- Run again after edits, then copy or download the current result for a review note.
Desk note. Listing a property under properties does not make it required. Put its name in the parent object’s required array when every instance must contain it.
Separate invalid JSON from a schema mismatch
A trailing comma or an unquoted key is a JSON syntax error. A well-formed object with the wrong value type is a validation result. The first requires repairing the input; the second requires deciding how the data and contract should agree. Both routes preserve the pasted source.
The schema checker rejects unsupported keywords rather than silently ignoring them. This includes $ref, pattern, format, and composition keywords such as oneOf. Even a descriptive $schema declaration is outside this tool’s supported keyword list. Do not strip meaningful constraints from a production schema and call the reduced check a complete validation.
Keep the test attached to the example
Use short examples with fictional data. The instance limit is 20,000 characters, the schema limit is 12,000 characters, and complexity limits also apply. Large or reference-heavy schemas belong in your project’s full validation toolchain.
After an example passes here, paste that same JSON into the guide and preview the surrounding explanation. If you edit a field while writing, repeat the check. A successful validation describes one instance against one supported schema at that moment.