JSON Schema: A Media Type for Describing JSON Documents
draft-bhutton-json-schema-00
Internet Engineering Task Force A. Wright, Ed.
Internet-Draft
Intended status: Informational H. Andrews, Ed.
Expires: June 11, 2021
B. Hutton, Ed.
G. Dennis
December 8, 2020
JSON Schema: A Media Type for Describing JSON Documents
draft-bhutton-json-schema-00
Abstract
JSON Schema defines the media type "application/schema+json", a JSON-
based format for describing the structure of JSON data. JSON Schema
asserts what a JSON document must look like, ways to extract
information from it, and how to interact with it. The "application/
schema-instance+json" media type provides additional feature-rich
integration with "application/schema+json" beyond what can be offered
for "application/json" documents.
Note to Readers
The issues list for this draft can be found at <https://github.com/
json-schema-org/json-schema-spec/issues>.
For additional information, see <https://json-schema.org/>.
To provide feedback, use this issue tracker, the communication
methods listed on the homepage, or email the document editors.
Status of This Memo
This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
Wright, et al. Expires June 11, 2021 [Page 1]
Internet-Draft JSON Schema December 2020
This Internet-Draft will expire on June 11, 2021.
Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Conventions and Terminology . . . . . . . . . . . . . . . . . 5
3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.1. JSON Document . . . . . . . . . . . . . . . . . . . . . . 6
4.2. Instance . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2.1. Instance Data Model . . . . . . . . . . . . . . . . . 6
4.2.2. Instance Equality . . . . . . . . . . . . . . . . . . 7
4.2.3. Non-JSON Instances . . . . . . . . . . . . . . . . . 8
4.3. JSON Schema Documents . . . . . . . . . . . . . . . . . . 8
4.3.1. JSON Schema Objects and Keywords . . . . . . . . . . 8
4.3.2. Boolean JSON Schemas . . . . . . . . . . . . . . . . 9
4.3.3. Schema Vocabularies . . . . . . . . . . . . . . . . . 10
4.3.4. Meta-Schemas . . . . . . . . . . . . . . . . . . . . 10
4.3.5. Root Schema and Subschemas and Resources . . . . . . 10
5. Fragment Identifiers . . . . . . . . . . . . . . . . . . . . 11
6. General Considerations . . . . . . . . . . . . . . . . . . . 12
6.1. Range of JSON Values . . . . . . . . . . . . . . . . . . 12
6.2. Programming Language Independence . . . . . . . . . . . . 12
6.3. Mathematical Integers . . . . . . . . . . . . . . . . . . 12
6.4. Regular Expressions . . . . . . . . . . . . . . . . . . . 12
6.5. Extending JSON Schema . . . . . . . . . . . . . . . . . . 13
7. Keyword Behaviors . . . . . . . . . . . . . . . . . . . . . . 13
7.1. Lexical Scope and Dynamic Scope . . . . . . . . . . . . . 14
7.2. Keyword Interactions . . . . . . . . . . . . . . . . . . 15
7.3. Default Behaviors . . . . . . . . . . . . . . . . . . . . 15
7.4. Identifiers . . . . . . . . . . . . . . . . . . . . . . . 16
7.5. Applicators . . . . . . . . . . . . . . . . . . . . . . . 16
7.5.1. Referenced and Referencing Schemas . . . . . . . . . 17
Show full document text