🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Web Development Intermediate

What is JSON Schema?

A vocabulary for validating the structure and content of JSON data, ensuring API requests and responses conform to expected formats.

JSON Schema defines the expected structure of JSON documents — required properties, data types, value constraints, array item schemas, and nested object structures. It serves multiple purposes: API request validation (reject malformed input), documentation (clear contract for API consumers), code generation (auto-generate types from schema), and testing (verify API responses). Validators exist for every language (PHP: justinrainbow/json-schema, Python: jsonschema, JavaScript: ajv). JSON Schema supports references ($ref) for reusable definitions, conditional validation (if/then/else), and composition (allOf, anyOf, oneOf). It is used in OpenAPI/Swagger specifications for API documentation.

Related Terms

CORS Preflight
An automatic OPTIONS request sent by browsers before certain cross-origin requests to check if the actual request is permitted.
Content Negotiation
An HTTP mechanism where client and server agree on the best representation of a resource based on format, language, or encoding preferences.
TypeScript
A typed superset of JavaScript that adds static type checking, interfaces, and advanced IDE support to JavaScript development.
Web Performance Optimization
Techniques to make websites load faster and respond more quickly, improving user experience and search engine rankings.
HTTP/2
The second major version of HTTP that improves performance through multiplexing, header compression, and server push.
CDN (Content Delivery Network)
A distributed network of servers that delivers web content to users from the geographically closest location.
View All Web Development Terms →