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

Document Type Active Internet-Draft (individual)
Last updated 2020-06-29 (latest revision 2020-06-28)
Replaces draft-ucarion-jddf
Stream ISE
Intended RFC status Experimental
Formats plain text pdf htmlized (tools) htmlized bibtex
IETF conflict review conflict-review-ucarion-json-type-definition
Stream ISE state Sent to the RFC Editor
Consensus Boilerplate Unknown
Document shepherd Adrian Farrel
Shepherd write-up Show (last changed 2020-05-06)
IESG IESG state I-D Exists
Telechat date
Responsible AD (None)
Send notices to Adrian Farrel <rfc-ise@rfc-editor.org>
IANA IANA review state Version Changed - Review Needed
IANA action state No IANA Actions
RFC Editor RFC Editor state EDIT
Independent Submission                                         U. Carion
Internet-Draft                                                   Segment
Intended status: Experimental                              June 28, 2020
Expires: December 30, 2020

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

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 December 30, 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 December 30, 2020               [Page 1]
Internet-Draft            JSON Type Definition                 June 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  . . . . . . . . . . . . . . . . .  17
   3.  Semantics . . . . . . . . . . . . . . . . . . . . . . . . . .  18
     3.1.  Allowing Additional Properties  . . . . . . . . . . . . .  18
     3.2.  Errors  . . . . . . . . . . . . . . . . . . . . . . . . .  19
     3.3.  Forms . . . . . . . . . . . . . . . . . . . . . . . . . .  20
       3.3.1.  Empty . . . . . . . . . . . . . . . . . . . . . . . .  20
       3.3.2.  Ref . . . . . . . . . . . . . . . . . . . . . . . . .  20
       3.3.3.  Type  . . . . . . . . . . . . . . . . . . . . . . . .  22
       3.3.4.  Enum  . . . . . . . . . . . . . . . . . . . . . . . .  27
       3.3.5.  Elements  . . . . . . . . . . . . . . . . . . . . . .  28
       3.3.6.  Properties  . . . . . . . . . . . . . . . . . . . . .  30
       3.3.7.  Values  . . . . . . . . . . . . . . . . . . . . . . .  34
       3.3.8.  Discriminator . . . . . . . . . . . . . . . . . . . .  36
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  42
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .  43
   6.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  43
     6.1.  Normative References  . . . . . . . . . . . . . . . . . .  43
     6.2.  Informative References  . . . . . . . . . . . . . . . . .  44
   Appendix A.  Rationale for Omitted Features . . . . . . . . . . .  44
Show full document text