JSON Schema
// Definition
A JSON-based vocabulary for describing the structure, constraints, and data types of JSON documents. A schema specifies required fields, allowed types (string, number, boolean, array, object), string patterns, numeric ranges, and nested object shapes. In API testing, JSON Schema validation is used to assert that every response conforms to the expected contract — catching breaking changes the moment a field is renamed, a type changes, or a required field goes missing.
// Related terms
Contract Testing
Verifying that two services agree on the shape of the messages they exchange. Catches breaking API changes without expensive end-to-end tests across multiple deployed services.
OpenAPI
A language-agnostic specification format for describing REST APIs — formerly called Swagger. An OpenAPI document (written in YAML or JSON) defines every endpoint, its HTTP method, request parameters, request body schema, possible responses, and authentication requirements. Teams use OpenAPI to generate client SDKs, server stubs, interactive documentation (Swagger UI), and automated test cases. Contract testing tools like Schemathesis derive hundreds of fuzz tests from a single spec.
Assertion
A statement in a test that checks an expected condition holds. If it doesn't, the test fails. The core of every automated test.