JSON Schema: A Media Type for Describing JSON Documents
draft-handrews-json-schema-00

Document Type Active Internet-Draft (individual)
Last updated 2017-11-20
Replaces draft-wright-json-schema
Stream (None)
Intended RFC status (None)
Formats plain text xml pdf html bibtex
Stream Stream state (No stream defined)
Consensus Boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date
Responsible AD (None)
Send notices to (None)
Internet Engineering Task Force                           A. Wright, Ed.
Internet-Draft
Intended status: Informational                           H. Andrews, Ed.
Expires: May 23, 2018                                   Cloudflare, Inc.
                                                       November 19, 2017

        JSON Schema: A Media Type for Describing JSON Documents
                     draft-handrews-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 <http://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."

   This Internet-Draft will expire on May 23, 2018.

Wright & Andrews          Expires May 23, 2018                  [Page 1]
Internet-Draft                 JSON Schema                 November 2017

Copyright Notice

   Copyright (c) 2017 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  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Conventions and Terminology . . . . . . . . . . . . . . . . .   3
   3.  Overview  . . . . . . . . . . . . . . . . . . . . . . . . . .   3
     3.1.  Validation  . . . . . . . . . . . . . . . . . . . . . . .   4
     3.2.  Hypermedia and Linking  . . . . . . . . . . . . . . . . .   4
   4.  Definitions . . . . . . . . . . . . . . . . . . . . . . . . .   4
     4.1.  JSON Document . . . . . . . . . . . . . . . . . . . . . .   4
     4.2.  Instance  . . . . . . . . . . . . . . . . . . . . . . . .   4
       4.2.1.  Instance Data Model . . . . . . . . . . . . . . . . .   4
       4.2.2.  Instance Media Types  . . . . . . . . . . . . . . . .   5
       4.2.3.  Instance Equality . . . . . . . . . . . . . . . . . .   6
     4.3.  JSON Schema Documents . . . . . . . . . . . . . . . . . .   6
       4.3.1.  JSON Schema Values and Keywords . . . . . . . . . . .   7
       4.3.2.  JSON Schema Vocabularies  . . . . . . . . . . . . . .   7
       4.3.3.  Root Schema and Subschemas  . . . . . . . . . . . . .   8
   5.  Fragment Identifiers  . . . . . . . . . . . . . . . . . . . .   8
   6.  General Considerations  . . . . . . . . . . . . . . . . . . .   9
     6.1.  Range of JSON Values  . . . . . . . . . . . . . . . . . .   9
     6.2.  Programming Language Independence . . . . . . . . . . . .   9
     6.3.  Mathematical Integers . . . . . . . . . . . . . . . . . .   9
     6.4.  Extending JSON Schema . . . . . . . . . . . . . . . . . .  10
   7.  The "$schema" Keyword . . . . . . . . . . . . . . . . . . . .  10
   8.  Schema References With "$ref" . . . . . . . . . . . . . . . .  11
   9.  Base URI and Dereferencing  . . . . . . . . . . . . . . . . .  11
     9.1.  Initial Base URI  . . . . . . . . . . . . . . . . . . . .  11
     9.2.  The "$id" Keyword . . . . . . . . . . . . . . . . . . . .  11
       9.2.1.  Internal References . . . . . . . . . . . . . . . . .  13
       9.2.2.  External References . . . . . . . . . . . . . . . . .  14
   10. Comments With "$comment"  . . . . . . . . . . . . . . . . . .  14
   11. Usage for Hypermedia  . . . . . . . . . . . . . . . . . . . .  14
Show full document text