JSON Schema Language
draft-json-schema-language-02

Document Type Active Internet-Draft (individual)
Last updated 2019-07-21
Stream (None)
Intended RFC status (None)
Formats plain text 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)
JSON Working Group                                             U. Carion
Internet-Draft                                             July 18, 2019
Intended status: Standards Track
Expires: January 19, 2020

                          JSON Schema Language
                     draft-json-schema-language-02

Abstract

   JavaScript Object Notation (JSON) Schema Language is a portable
   method for describing the format of JSON ([RFC8259], JavaScript
   Object Notation) data and the errors associated with ill-formed data.

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 January 19, 2020.

Copyright Notice

   Copyright (c) 2019 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.

Carion                  Expires January 19, 2020                [Page 1]
Internet-Draft            JSON Schema Language                 July 2019

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Requirements notation . . . . . . . . . . . . . . . . . .   3
     1.2.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Syntax  . . . . . . . . . . . . . . . . . . . . . . . . . . .   3
   3.  Semantics . . . . . . . . . . . . . . . . . . . . . . . . . .   9
     3.1.  Strict instance semantics . . . . . . . . . . . . . . . .   9
     3.2.  Errors  . . . . . . . . . . . . . . . . . . . . . . . . .  10
     3.3.  Forms . . . . . . . . . . . . . . . . . . . . . . . . . .  10
       3.3.1.  Empty . . . . . . . . . . . . . . . . . . . . . . . .  10
       3.3.2.  Ref . . . . . . . . . . . . . . . . . . . . . . . . .  10
       3.3.3.  Type  . . . . . . . . . . . . . . . . . . . . . . . .  12
       3.3.4.  Enum  . . . . . . . . . . . . . . . . . . . . . . . .  14
       3.3.5.  Elements  . . . . . . . . . . . . . . . . . . . . . .  14
       3.3.6.  Properties  . . . . . . . . . . . . . . . . . . . . .  15
       3.3.7.  Values  . . . . . . . . . . . . . . . . . . . . . . .  18
       3.3.8.  Discriminator . . . . . . . . . . . . . . . . . . . .  18
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  22
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .  22
   6.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  22
     6.1.  Normative References  . . . . . . . . . . . . . . . . . .  22
     6.2.  Informative References  . . . . . . . . . . . . . . . . .  23
   Appendix A.  Comparison with CDDL . . . . . . . . . . . . . . . .  23
   Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  26
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .  26

1.  Introduction

   This document describes a schema language for JSON [RFC8259] called
   JSON Schema Language (JSL).

   The goals of JSL are to:

   o  Provide an unambiguous description of the overall structure of a
      JSON document.

   o  Be able to describe common JSON datatypes and structures.

   o  Provide a single format that is readable and editable by both
      humans and machines, and which can be embedded within other JSON
      documents.

   o  Enable code generation from schemas.

   o  Provide a standardized format for errors when data does not
      conform with a schema.

Carion                  Expires January 19, 2020                [Page 2]
Internet-Draft            JSON Schema Language                 July 2019

   JSL is intentionally designed as a rather minimal schema language.
   For example, JSL is homoiconic (it both describes, and is written in,
   JSON) yet is incapable of describing in detail its own structure.  By
   keeping the expressiveness of the schema language minimal, JSL makes
   code generation and standardized errors easier to implement.

   It is expected that for many use-cases, a schema language of JSL's
Show full document text