JSON Schema
Also known as: JSON Schema Specification, Schema Definition
Definition
A vocabulary for annotating and validating JSON documents, widely used in LLM applications to define tool parameters, structured output formats, and API request/response shapes. JSON Schema provides a standard way to describe what valid JSON looks like, enabling both documentation and runtime validation.
What this is NOT
- Not JSON itself (JSON Schema describes JSON)
- Not a programming language (it's a schema language)
- Not TypeScript types (though often equivalent)
Alternative Interpretations
Different communities use this term differently:
llm-practitioners
The schema language used to define tool/function parameters for function calling and structured output. Models receive JSON Schema definitions and produce conforming JSON output.
Sources: OpenAI Function Calling documentation, JSON Schema specification (json-schema.org)
software-engineering
A specification for describing the structure of JSON data, including types, required fields, constraints, and nested structures. Used for API documentation (OpenAPI), configuration validation, and data contracts.
Sources: JSON Schema specification, OpenAPI specification
Examples
- Tool parameter schema with type, properties, required
- Structured output schema for data extraction
- OpenAPI 3.0 specification using JSON Schema
- Validating LLM output against a schema
Counterexamples
Things that might seem like JSON Schema but are not:
- Raw JSON data (JSON Schema describes JSON, isn't JSON)
- TypeScript interface (different language)
- XML Schema (different format)
Relations
- overlapsWith tool-definition (Tool parameters use JSON Schema)
- overlapsWith structured-output (Structured output constraints use JSON Schema)
- overlapsWith function-calling (Function parameters defined with JSON Schema)