Contract laboratory
JSON Schema & OpenAPI Validator — Validate Instances and Contracts
JSON parsing, schema correctness, instance validation, and OpenAPI contract inspection are separate jobs. This workspace keeps their evidence separate.
- 01
Parse document
Is the JSON or YAML syntax readable?
- 02
Check schema
Does the schema follow its selected dialect?
- 03
Validate instance
Does the data satisfy that schema?
- 04
Inspect API
Do paths, operations, components, and references form a reviewable contract?
Draft choice changes vocabulary and reference behavior
| Question | Draft-07 | 2020-12 / OpenAPI 3.1 |
|---|---|---|
| Reusable definitions | definitions | $defs |
| Array tuple rules | items array | prefixItems |
| OpenAPI relationship | Older 3.0-style subset | OpenAPI 3.1 uses the vocabulary |
Instance error trace
Follow the instance path and the schema path together.
/items/1/price must be >= 0 ↳ schema /properties/items/items/properties/price/minimum
The instance pointer identifies the failing value. The schema pointer identifies the rule. Keeping both prevents a vague error list from becoming a scavenger hunt.
OpenAPI 3.1 connects HTTP operations to JSON Schema
Inspect the graph before comparing contracts: a component can be reused by many operations, and a local reference can amplify one change across the API.
Local references are deterministic; remote references are a trust decision
DevSexy resolves references already present in the supplied document. It does not fetch arbitrary remote URLs and does not claim an unresolved reference passed validation.
#/components/schemas/Order → resolved locally https://…/common.json → reported as remote
Breaking-change review needs judgment
- Removed path or operation
- New required parameter or property
- Narrower enum or numeric range
- Response status or media-type change
- Changed authentication requirements
The checklist highlights candidates; compatibility still depends on consumers, defaults, and deployment policy.
Schema and OpenAPI questions
- Is valid JSON automatically valid against a schema?
- No. Parsing only proves syntax. Instance validation applies the types, required fields, formats, and constraints defined by a schema.
- Is OpenAPI 3.1 JSON Schema?
- OpenAPI 3.1 aligns its Schema Object with JSON Schema 2020-12, while the full OpenAPI document also defines paths, operations, parameters, responses, and other API structure.
- Does the tool load remote references?
- No. Remote references are reported rather than fetched so validation remains local and deterministic.