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

Document Type Active Internet-Draft (individual)
Last updated 2016-10-13
Replaces draft-zyp-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                                          October 13, 2016
Intended status: Informational
Expires: April 16, 2017

        JSON Schema: A Media Type for Describing JSON Documents
                      draft-wright-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, ideal for
   annotating existing JSON APIs that would not otherwise have
   hypermedia controls or be machine-readable.

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 http://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 April 16, 2017.

Wright                   Expires April 16, 2017                 [Page 1]
Internet-Draft                 JSON Schema                  October 2016

Copyright Notice

   Copyright (c) 2016 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
   (http://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  . . . . . . . . . . . . . . . . . . . . . . .   3
     3.2.  Hypermedia and linking  . . . . . . . . . . . . . . . . .   4
   4.  Definitions . . . . . . . . . . . . . . . . . . . . . . . . .   4
     4.1.  JSON document . . . . . . . . . . . . . . . . . . . . . .   4
     4.2.  instance  . . . . . . . . . . . . . . . . . . . . . . . .   4
     4.3.  instance equality . . . . . . . . . . . . . . . . . . . .   5
     4.4.  JSON Schema document  . . . . . . . . . . . . . . . . . .   5
     4.5.  Root schema and subschemas  . . . . . . . . . . . . . . .   6
   5.  General considerations  . . . . . . . . . . . . . . . . . . .   6
     5.1.  Range of JSON values  . . . . . . . . . . . . . . . . . .   6
     5.2.  Programming language independence . . . . . . . . . . . .   6
     5.3.  Mathematical integers . . . . . . . . . . . . . . . . . .   7
     5.4.  Extending JSON Schema . . . . . . . . . . . . . . . . . .   7
   6.  The "$schema" keyword . . . . . . . . . . . . . . . . . . . .   7
     6.1.  Purpose . . . . . . . . . . . . . . . . . . . . . . . . .   7
   7.  Schema references with $ref . . . . . . . . . . . . . . . . .   7
   8.  Base URI and dereferencing  . . . . . . . . . . . . . . . . .   8
     8.1.  Initial base URI  . . . . . . . . . . . . . . . . . . . .   8
     8.2.  The "id" keyword  . . . . . . . . . . . . . . . . . . . .   8
       8.2.1.  Internal references . . . . . . . . . . . . . . . . .   9
       8.2.2.  External references . . . . . . . . . . . . . . . . .  10
   9.  Usage for hypermedia  . . . . . . . . . . . . . . . . . . . .  10
     9.1.  Linking to a schema . . . . . . . . . . . . . . . . . . .  11
     9.2.  Describing a profile of JSON  . . . . . . . . . . . . . .  11
     9.3.  Usage over HTTP . . . . . . . . . . . . . . . . . . . . .  12
   10. Security considerations . . . . . . . . . . . . . . . . . . .  12
   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  13
Show full document text