JSON Schema is a declarative language that defines the structure, content, and constraints of JSON data. It enables validation, documentation, and interaction control for JSON documents by specifying expected types, required fields, and value constraints.

Key Features

  • Validation: Ensures JSON data adheres to a defined structure (e.g., required fields, data types, range limits).

  • Standardization: Maintained by the json-schema.org community, with evolving drafts (e.g., Draft 2020-12 being the latest stable version).

  • Self-Describing: A JSON Schema is itself a valid JSON document, using keywords like type, properties, required, minimum, maximum, and pattern.

Common Use Cases

  • Validating API request/response payloads.

  • Generating dynamic forms in frontend frameworks (e.g., React with RJSF or JSON Forms).

  • Enforcing data integrity in databases (e.g., Oracle AI Database).

  • Automating testing and documentation.

Example Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Person",
  "description": "A person with name and age",
  "type": "object",
  "properties": {
    "name": { "type": "string", "minLength": 1 },
    "age": { "type": "integer", "minimum": 18, "maximum": 64 }
  },
  "required": ["name", "age"]
}

Tools & Libraries

  • Python: jsonschema library supports Draft 2020-12 and above.

  • JavaScript/Node.js: Use ajv (Another JSON Validator) for high-performance validation.

  • Postman: Built-in JSON Schema validation for API testing.

  • Command Line: Use check-jsonschema (installed via pip or npm) for validating JSON files.

Best Practices

  • Always include the $schema keyword to specify the draft version.

  • Use description and title for better documentation.

  • Leverage enum for allowed values, const for exact matches, and format for standardized formats (e.g., email, date-time).

For more details, visit the official JSON Schema website.

🌐
JSON Schema
json-schema.org
JSON Schema
While JSON is probably the most popular format for exchanging data, JSON Schema is the vocabulary that enables JSON data consistency, validity, and interoperability at scale.
Specification [#section]
The specification is split into two parts, Core and Validation. We also publish the Relative JSON Pointers spec although it's not currently used by Core or Validation in any significant way. The meta-schemas are schemas against which other schemas can be validated.
Understanding JSON Schema
Master the full power of JSON Schema with our reference documentation. From basic data types to advanced techniques like conditional validation and schema composition, you will learn everything about JSON Schema keywords through clear explanations and examples.
Creating your first schema
If you already know how to create JSON Schemas and you are looking for different JSON Schema use cases like schema generation, code generation, documentation, UI generation or JSON Schema processing or conversion, please visit Tools and explore the amazing tooling available in the JSON Schema ...
JSON Schema reference
Master the full power of JSON Schema with our reference documentation. From basic data types to advanced techniques like conditional validation and schema composition, you will learn everything about JSON Schema keywords through clear explanations and examples.
🌐
MongoDB
mongodb.com › resources › languages › json-schema-examples
JSON Schema Examples Tutorial | MongoDB
JSON Schema is a model that represents the format and structure of a common group of JSON documents.
Discussions

The Last Breaking Change | JSON Schema Blog
always fun to see the json guys struggling with the previous generation's xml issues. Not that I particularly like either, you understand, and honestly json is obviously less crushingly verbose, it's just amusing. People do seem to have to learn the hard way that a lot of the "complicated" stuff xml had was there for a reason. Wonder what format the next generation will be insisting is better that xml and json. https://en.wikipedia.org/wiki/Unique_Particle_Attribution https://lists.w3.org/Archives/Public/www-tag/2004Aug/att-0010/NRMVersioningProposal.html More on reddit.com
🌐 r/programming
270
529
March 5, 2023
Wtf is json schema
The purpose is to ensure that your software receives a complete, well-formed JSON document. After validation, the code you write can make the assumption that the input JSON being parsed has all the expected keys and values. A json schema is a text file (which is also valid json by the way) that describes the structure and expected types of values in a JSON document. Once you have a schema file, you can use a tool or library to validate a JSON document against the schema. If it passes schema validation, then your code can parse it and presumably won't hit errors about missing or invalid input. If not, then the error message will describe what is wrong with the JSON. For software developers this lets you validate your input in one step, first thing when your JSON input is provided. This has several advantages over writing your own validation code: Code can fail and print an error immediately when given bad input, rather than parsing some of it first Less validation code to write overall Syntax validation code is concentrated in one place instead of distributed throughout your parser code. This allows the parser to focus on detecting semantic problems instead of syntax violations. Helps keep things straight when your input JSON may have multiple versions that have different requirements The json schema itself is readable by humans and useful for understanding the structure of the document. This helps devs understand the input document when they write the code that parses and uses it. XML had the same problems, it also had several different schema formats for accomplishing this. More on reddit.com
🌐 r/json
2
2
December 8, 2021
Data validation with JSON schema
I really dislike how JSONSchema considers every property as optional by default. It should have been the other way around. Every property that I define a type for should have been required unless it is marked optional. It sounds much more sensible: If I defined an age field that is an integer in a specific range I expect it to be present. Specifying types for properties that might or might not be there sounds like the less likely case to me. More on reddit.com
🌐 r/programming
13
8
July 25, 2021
JSON Schema as Source of Truth
You want to use JSON schema to design a relational database? More on reddit.com
🌐 r/devops
9
2
June 1, 2023
🌐
Postman
blog.postman.com › home › what is json schema?
What Is JSON Schema? | Postman Blog
October 23, 2023 - For example, example responses to an API request can be generated based on an API definition that uses JSON Schema. These example responses can then be used to create mock servers. Dynamic form generation: JSON Schema’s declarative nature makes it possible to represent form data and its respective validations as a schema definition.
🌐
Oracle
docs.oracle.com › en › database › oracle › oracle-database › 26 › adjsn › json-schema.html
JSON Schema
January 22, 2026 - JSON schemas can in turn be used to describe or validate other JSON documents. See json-schema.org. A JSON schema specifies the structure and the types of allowed values of JSON data that it considers valid. "Validity" is always with respect to a given schema.
🌐
GitHub
github.com › json-schema-org
JSON Schema · GitHub
Welcome to JSON Schema, a declarative language that allows you to annotate and validate JSON documents.
🌐
Cswr
cswr.github.io › JsonSchema › spec › definitions_references
Definitions & References - JSON Schema
The idea of a reference such as {"$ref": "#/definitions/person"} is to use the schema that is stored under the result of evaluating the pointer /definitions/person under the same document that is defining the JSON Schema.
Find elsewhere
🌐
JSON Schema Validator
jsonschemavalidator.net
JSON Schema Validator - Newtonsoft
public class JsonSchemaController : ControllerBase { [HttpPost] [Route("api/jsonschema/validate")] public ValidateResponse Validate(ValidateRequest request) { // Load schema JSchema schema = JSchema.Parse(request.Schema); JToken json = JToken.Parse(request.Json); // Validate json IList<ValidationError> errors; bool valid = json.IsValid(schema, out errors); // Return error messages and line info to the browser return new ValidateResponse { Valid = valid, Errors = errors }; } } public class ValidateRequest { public string Json { get; set; } public string Schema { get; set; } } public class ValidateResponse { public bool Valid { get; set; } public IList<ValidationError> Errors { get; set; } }
🌐
GitHub
github.com › python-jsonschema › jsonschema
GitHub - python-jsonschema/jsonschema: An implementation of the JSON Schema specification for Python · GitHub
An implementation of the JSON Schema specification for Python - python-jsonschema/jsonschema
Starred by 4.9K users
Forked by 609 users
Languages   Python 99.8% | TypeScript 0.2%
🌐
TutorialsPoint
tutorialspoint.com › json › json_schema.htm
JSON - Schema
JSON Schema is a specification for JSON based format for defining the structure of JSON data. It was written under IETF draft which expired in 2011. JSON Schema − There are several validators currently available for different programming languages.
🌐
PyPI
pypi.org › project › jsonschema
jsonschema · PyPI
An implementation of JSON Schema validation for Python
      » pip install jsonschema
    
Published   Jan 07, 2026
Version   4.26.0
🌐
Learnjsonschema
learnjsonschema.com › 2020-12
JSON Schema 2020-12
Reference documentation for JSON Schema 2020-12. JSON Schema 2020-12 is a JSON media type for defining the structure of JSON data. JSON Schema is intended to define validation, documentation, hyperlink navigation, and interaction control of JSON data.
🌐
RestfulAPI
restfulapi.net › home › json › json schema
JSON Schema
November 4, 2023 - JSON Schema is a grammar language for defining the structure, content, and (to some extent) semantics of JSON objects. It lets you specify metadata (data about data) about what an object’s properties mean and what values are valid for those ...
🌐
Lightblue
docs.lightblue.io › standards › json_schema.html
JSON Schema · lightblue User Guide
This section doesn't aim to define the Lightblue use of the schema, so look to later sections for that detail. In summary, a json schema is just a json document that conforms to the schema specification [1]. For Lightblue purposes, it defined some resources (files) in the project.
🌐
Pydantic
docs.pydantic.dev › latest › concepts › json_schema
JSON Schema - Pydantic Validation
Specify the mode of JSON schema generation via the mode parameter in the model_json_schema and TypeAdapter.json_schema methods. By default, the mode is set to 'validation', which produces a JSON schema corresponding to the model's validation schema. The JsonSchemaMode is a type alias that represents the available options for the mode parameter:
🌐
Transform
transform.tools › json-to-json-schema
JSON to JSON Schema
An online playground to convert JSON to JSON Schema
🌐
Zod
zod.dev › json-schema
JSON Schema | Zod
New — Zod 4 introduces a new feature: native JSON Schema conversion. JSON Schema is a standard for describing the structure of JSON (with JSON).
🌐
Medium
dashjoin.medium.com › json-schema-schema-org-json-ld-whats-the-difference-e30d7315686a
JSON Schema, Schema.org, JSON-LD: What’s the Difference? | by Andreas Eberhart | Medium
January 7, 2022 - It allows you to specify the structure of a JSON document. You can state that the field “email” must follow a certain regular expression or that an address has “street_name”, “number”, and “street_type” fields.
🌐
Newtonsoft
newtonsoft.com › jsonschema
Json.NET Schema - Newtonsoft
Json.NET Schema is a complete and easy to use JSON Schema framework for .NET