JSON Schema
JSON Schema is a standard vocabulary and specification for describing, validating, and annotating the structure and constraints of JSON data.
Data-Oriented Programming: Reduce software complexity
JSON Schema is a language and vocabulary for describing constraints on JSON data and validating JSON instances against those constraints.
- How it is used
- Validates JSON-shaped data at system boundaries and clarifies function contracts during development.
- How deep it goes
- Descends from object and array schemas through composition, strictness, runtime ranges, patterns, formats, and function-argument validation.
- Examples
- Demonstrates book-search requests, database responses, Open Library responses, catalog data, UUIDs, dates, and function arguments.
- What you can do after
- Build it from scratch by defining schemas, composing constraints, validating data with Ajv, and interpreting validation failures.
Read how Data-Oriented Programming: Reduce software complexity explains JSON Schema →
The Design of Web APIs, Second Edition
A JSON Schema format is an annotation identifying an expected semantic representation for a value of a specified JSON data type.
- How it is used
- Defines resource and operation data in OpenAPI and supports design, documentation, mocking, and testing.
- How deep it goes
- Works through types, properties, required fields, arrays, references, and selected constraints; defers less common keywords to reference documentation.
- Examples
- Uses a product resource, an inline product identifier parameter, a Location header, and a constrained 500-error response.
- What you can do after
- Build it from scratch in OpenAPI using reusable resource schemas, inline operation schemas, and references where models are shared.
Read how The Design of Web APIs, Second Edition explains JSON Schema →
Kafka Streams in Action, Second Edition
JSON Schema is a vocabulary and specification for describing and validating the structure and constraints of JSON data.
- How it is used
- Defines JSON event contracts for Schema Registry-backed Kafka producers and consumers.
- How deep it goes
- Explains object properties, required fields, defaults, references, generation, and serializer configuration; defers full JSON Schema specification details.
- Examples
- Uses Avenger objects, a Company executives array referencing person.json, and a typed SimpleAvengerJson consumer configuration.
- What you can do after
- Apply it via Schema Registry and Kafka JSON Schema serializers to exchange typed or generic Java JSON records.
Read how Kafka Streams in Action, Second Edition explains JSON Schema →
Build a Multi-Agent System (from Scratch)
JSON Schema is a standard for describing and validating the structure, data types, and constraints of JSON data.
- How it is used
- Standardize tool parameter descriptions for LLM tool-calling APIs and SDKs.
- How deep it goes
- Builds schemas manually and from inspected signatures, then validates arguments; identifies Pydantic as a more robust alternative.
- Examples
- Uses a required numeric x parameter for a Hailstone step and generates schemas from Python function annotations.
- What you can do after
- Apply it via jsonschema to validate tool-call arguments before invoking wrapped Python functions.
Read how Build a Multi-Agent System (from Scratch) explains JSON Schema →
Build an AI Agent (From Scratch)
JSON Schema is a standard for describing and validating the structure, types, allowed values, and required fields of JSON data.
- How it is used
- Defines structured tool inputs so an LLM can select and invoke functions with constrained arguments.
- How deep it goes
- Explains object types, properties, enums, and required fields, but stops short of broader schema validation internals.
- Examples
- Uses a calculator definition, arithmetic enum, multiplication request, parsed arguments, and returned result.
- What you can do after
- Build it from scratch by defining calculator parameters and processing the model's generated tool arguments.
Read how Build an AI Agent (From Scratch) explains JSON Schema →
Microservices Patterns, Second Edition
JSON Schema is a declarative specification for describing and validating the structure and constraints of JSON data.
- How it is used
- Documents message properties and supports validation of incoming and outgoing JSON messages.
- How deep it goes
- Defines property names, types, and requiredness, but does not detail schema implementation.
- What you can do after
- Apply JSON Schema to document message properties and validate incoming or outgoing messages.
Read how Microservices Patterns, Second Edition explains JSON Schema →
Also covered in
- Kafka for Architects
- Automating API Delivery
- Designing AI SystemsIn early access (MEAP)
- MongoDB 8.0 in Action, Third Edition
- Contract Testing in Action
- Secure APIs
- Context EngineeringIn early access (MEAP)
What to know first
- JSONJSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
- AvroA language-independent data serialization system that uses schemas to encode structured data, commonly in a compact binary format.
- booleanA Boolean is a logical value or data type representing truth or falsity, conventionally with the two values true and false.
- HTTP GETHTTP GET is a safe, idempotent HTTP method that requests a representation of a resource without intending to change its state.
Related concepts
- OpenAPI specificationused by · The OpenAPI Specification is a machine-readable standard for describing HTTP APIs, including their operations, inputs, outputs, data structures, and security requirements.
- BaseModel.model_json_schema()produced by · BaseModel.model_json_schema() is a Pydantic method that generates a JSON Schema describing a model.
- ollama.chat()used by · ollama.chat() is a function in the Ollama Python library that sends conversational messages to a specified model and returns its response.
- Spectralused by · Spectral is an open-source linter that applies configurable rules to JSON, YAML, and structured API description documents.
- default valueuses · A default value is a predefined value automatically applied when no explicit value is supplied or specified.
Questions about JSON Schema
What is JSON Schema?
JSON Schema is a standard vocabulary and specification for describing, validating, and annotating the structure and constraints of JSON data.
Which Manning books explain JSON Schema?
Data-Oriented Programming: Reduce software complexity, The Design of Web APIs, Second Edition, Kafka Streams in Action, Second Edition, Build a Multi-Agent System (from Scratch), Build an AI Agent (From Scratch) and Microservices Patterns, Second Edition.
What should I know before learning JSON Schema?
Manning books that teach JSON Schema usually introduce JSON, Avro, boolean and HTTP GET first.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.





