JSON Schema Language (JSL)
draft-ucarion-json-schema-language-02

Document Type Active Internet-Draft (individual)
Last updated 2019-08-09
Stream (None)
Intended RFC status (None)
Formats plain text pdf htmlized 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)
Independent Submission                                         U. Carion
Internet-Draft                                           August 09, 2019
Intended status: Informational
Expires: February 10, 2020

                       JSON Schema Language (JSL)
                 draft-ucarion-json-schema-language-02

Abstract

   JSON Schema Language (JSL) is a portable method for describing the
   format of JavaScript Object Notation (JSON) data and the errors
   associated with ill-formed data.  JSL is designed to enable code
   generation from schemas.

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 February 10, 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 February 10, 2020               [Page 1]
Internet-Draft         JSON Schema Language (JSL)            August 2019

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Syntax  . . . . . . . . . . . . . . . . . . . . . . . . . . .   3
   3.  Semantics . . . . . . . . . . . . . . . . . . . . . . . . . .  11
     3.1.  Strict instance semantics . . . . . . . . . . . . . . . .  11
     3.2.  Errors  . . . . . . . . . . . . . . . . . . . . . . . . .  12
     3.3.  Forms . . . . . . . . . . . . . . . . . . . . . . . . . .  12
       3.3.1.  Empty . . . . . . . . . . . . . . . . . . . . . . . .  12
       3.3.2.  Ref . . . . . . . . . . . . . . . . . . . . . . . . .  12
       3.3.3.  Type  . . . . . . . . . . . . . . . . . . . . . . . .  14
       3.3.4.  Enum  . . . . . . . . . . . . . . . . . . . . . . . .  16
       3.3.5.  Elements  . . . . . . . . . . . . . . . . . . . . . .  16
       3.3.6.  Properties  . . . . . . . . . . . . . . . . . . . . .  17
       3.3.7.  Values  . . . . . . . . . . . . . . . . . . . . . . .  19
       3.3.8.  Discriminator . . . . . . . . . . . . . . . . . . . .  20
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  24
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .  24
   6.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  24
     6.1.  Normative References  . . . . . . . . . . . . . . . . . .  24
     6.2.  Informative References  . . . . . . . . . . . . . . . . .  25
   Appendix A.  Comparison with CDDL . . . . . . . . . . . . . . . .  25
   Appendix B.  Examples . . . . . . . . . . . . . . . . . . . . . .  27
   Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  28
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .  28

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 February 10, 2020               [Page 2]
Internet-Draft         JSON Schema Language (JSL)            August 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.
Show full document text