JSON Type Definition
draft-ucarion-json-type-definition-01

Document Type Active Internet-Draft (individual)
Last updated 2020-03-22
Replaces draft-ucarion-jddf
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                                                   Segment
Intended status: Experimental                             March 22, 2020
Expires: September 23, 2020

                          JSON Type Definition
                 draft-ucarion-json-type-definition-01

Abstract

   This document proposes a format, called JSON Type Definition (JTD),
   for describing the shape of JavaScript Object Notation (JSON)
   messages.  Its main goals are to enable code generation from schemas
   as well as portable validation with standardized error indicators.
   To this end, JTD is intentionally limited to be no more expressive
   than the type systems of mainstream programming languages.  This
   intentional limitation, as well as the decision to make JTD schemas
   be JSON documents, makes tooling atop of JTD easier to build.

   This document does not have IETF consensus and is presented here to
   facilitate experimentation with the concept of JTD.

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 September 23, 2020.

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

Carion                 Expires September 23, 2020               [Page 1]
Internet-Draft            JSON Type Definition                March 2020

   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
     1.1.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   5
     1.2.  Scope of Experiment . . . . . . . . . . . . . . . . . . .   5
   2.  Syntax  . . . . . . . . . . . . . . . . . . . . . . . . . . .   6
     2.1.  Root vs. non-root schemas . . . . . . . . . . . . . . . .   9
     2.2.  Forms . . . . . . . . . . . . . . . . . . . . . . . . . .   9
       2.2.1.  Empty . . . . . . . . . . . . . . . . . . . . . . . .   9
       2.2.2.  Ref . . . . . . . . . . . . . . . . . . . . . . . . .  10
       2.2.3.  Type  . . . . . . . . . . . . . . . . . . . . . . . .  11
       2.2.4.  Enum  . . . . . . . . . . . . . . . . . . . . . . . .  11
       2.2.5.  Elements  . . . . . . . . . . . . . . . . . . . . . .  12
       2.2.6.  Properties  . . . . . . . . . . . . . . . . . . . . .  13
       2.2.7.  Values  . . . . . . . . . . . . . . . . . . . . . . .  14
       2.2.8.  Discriminator . . . . . . . . . . . . . . . . . . . .  15
     2.3.  Extending JTD's Syntax  . . . . . . . . . . . . . . . . .  16
   3.  Semantics . . . . . . . . . . . . . . . . . . . . . . . . . .  17
     3.1.  Allowing Additional Properties  . . . . . . . . . . . . .  17
     3.2.  Errors  . . . . . . . . . . . . . . . . . . . . . . . . .  19
     3.3.  Forms . . . . . . . . . . . . . . . . . . . . . . . . . .  19
       3.3.1.  Empty . . . . . . . . . . . . . . . . . . . . . . . .  19
       3.3.2.  Ref . . . . . . . . . . . . . . . . . . . . . . . . .  19
       3.3.3.  Type  . . . . . . . . . . . . . . . . . . . . . . . .  21
       3.3.4.  Enum  . . . . . . . . . . . . . . . . . . . . . . . .  26
       3.3.5.  Elements  . . . . . . . . . . . . . . . . . . . . . .  27
       3.3.6.  Properties  . . . . . . . . . . . . . . . . . . . . .  29
       3.3.7.  Values  . . . . . . . . . . . . . . . . . . . . . . .  33
       3.3.8.  Discriminator . . . . . . . . . . . . . . . . . . . .  35
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  41
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .  42
   6.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  42
     6.1.  Normative References  . . . . . . . . . . . . . . . . . .  42
     6.2.  Informative References  . . . . . . . . . . . . . . . . .  43
   Appendix A.  Other Considerations . . . . . . . . . . . . . . . .  43
Show full document text