JSON Schema
A JSON document that describes what valid JSON looks like: fields, types, required properties and allowed values.
Definition
Teams use JSON Schema (often generated from an OpenAPI file) to check API responses automatically. A schema test catches renamed or missing fields, wrong types and unexpected fields that a status-code check would miss. Postman can validate a response with pm.response.to.have.jsonSchema(schema).
In practice
A schema that requires "total" to be a number fails when an endpoint suddenly returns "total": "24.99".
Learn it in context
Lessons that use this term.
Related terms
- OpenAPIA standard file format that describes an API's endpoints, parameters and responses (formerly called Swagger).
- JSONA simple text format for data, used by most APIs, like {"name": "Anna", "age": 31}.
- Contract testingChecking that two services keep to their agreed API contract: fields, types and status codes.