JSON Schema
JSON Schema is a vocabulary that allows you to annotate and validate JSON documents.
Introduction
The JSON document being validated or described we call the instance, and the document containing the description is called the schema.
The most basic schema is a blank JSON object, which constrains nothing, allows anything, and describes nothing:
{}
You can apply constraints on an instance by adding validation keywords to the schema. For instance, the “type” keyword can be used to restrict an instance to an object, array, string, number, boolean, or null:
{ "type": "string" }
JSON Schema is hypermedia ready, and ideal for annotating your existing JSON-based HTTP API. JSON Schema documents are identified by URIs, which can be used in HTTP Link headers, and inside JSON Schema documents to allow recursive definitions.
Continue reading the Reference guide.
The Specification
If you implement or use JSON Schema, get involved with the community of other developers! We officially hang out at the following places:
- the Google Group - For general questions, support, announcements, suggestions, and controversy; start here.
- the Specification repository on GitHub - If you have a particular change you'd like to propose, and you've discussed it with the community, get involved at the GitHub repository.
- the Website repository on GitHub - If you have an implementation you'd like to list, a change to make to one of the pages on this website, or have found a spelling problem, open an issue here.
- the IRC channel (Freenode Webchat) - If you wanna chat with people who implement and use JSON Schema, join our Freenode channel. Say something, and be patient for a response! It might take a few hours for the right person to see your question.