A Language for Rules Describing JSON Content
draft-newton-json-content-rules-07

Document Type Active Internet-Draft (individual)
Last updated 2016-09-18
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)
Network Working Group                                          A. Newton
Internet-Draft                                                      ARIN
Intended status: Standards Track                              P. Cordell
Expires: March 22, 2017                                        Codalogic
                                                      September 18, 2016

              A Language for Rules Describing JSON Content
                   draft-newton-json-content-rules-07

Abstract

   This document describes a language for specifying and testing the
   expected content of JSON structures found in JSON-using protocols,
   software, and processes.

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 March 22, 2017.

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.

Newton & Cordell         Expires March 22, 2017                 [Page 1]
Internet-Draft             JSON Content Rules             September 2016

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  A First Example: Specifying Content . . . . . . . . . . .   3
     1.2.  A Second Example: Testing Content . . . . . . . . . . . .   3
   2.  Overview of the Language  . . . . . . . . . . . . . . . . . .   5
   3.  Lines and Comments  . . . . . . . . . . . . . . . . . . . . .   7
   4.  Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . .   8
     4.1.  Rule Names and Assignments  . . . . . . . . . . . . . . .   8
     4.2.  Annotations . . . . . . . . . . . . . . . . . . . . . . .   9
     4.3.  Starting Points and Root Rules  . . . . . . . . . . . . .  10
     4.4.  Type Specifications . . . . . . . . . . . . . . . . . . .  10
     4.5.  Primitive Specifications  . . . . . . . . . . . . . . . .  12
       4.5.1.  Numbers, Booleans and Null  . . . . . . . . . . . . .  12
       4.5.2.  Strings . . . . . . . . . . . . . . . . . . . . . . .  13
     4.6.  Any Type  . . . . . . . . . . . . . . . . . . . . . . . .  16
     4.7.  Member Specifications . . . . . . . . . . . . . . . . . .  16
     4.8.  Object Specifications . . . . . . . . . . . . . . . . . .  16
     4.9.  Array Specifications  . . . . . . . . . . . . . . . . . .  19
       4.9.1.  Unordered Array Specifications  . . . . . . . . . . .  21
     4.10. Group Specifications  . . . . . . . . . . . . . . . . . .  21
     4.11. Ordered and Unordered Groups in Arrays  . . . . . . . . .  22
     4.12. Sequence and Choice Combinations in Array, Object, and
           Group Specifications  . . . . . . . . . . . . . . . . . .  22
     4.13. Repetition in Array, Object, and Group Specifications . .  23
     4.14. Negating Evaluation . . . . . . . . . . . . . . . . . . .  25
   5.  Directives  . . . . . . . . . . . . . . . . . . . . . . . . .  26
     5.1.  jcr-version . . . . . . . . . . . . . . . . . . . . . . .  26
     5.2.  ruleset-id  . . . . . . . . . . . . . . . . . . . . . . .  27
     5.3.  import  . . . . . . . . . . . . . . . . . . . . . . . . .  27
   6.  Tips and Tricks . . . . . . . . . . . . . . . . . . . . . . .  28
     6.1.  Any Member with Any Value . . . . . . . . . . . . . . . .  28
     6.2.  Lists of Values . . . . . . . . . . . . . . . . . . . . .  29
     6.3.  Groups in Arrays  . . . . . . . . . . . . . . . . . . . .  29
     6.4.  Groups in Objects . . . . . . . . . . . . . . . . . . . .  30
     6.5.  Group Rules as Macros . . . . . . . . . . . . . . . . . .  31
     6.6.  Object Mixins . . . . . . . . . . . . . . . . . . . . . .  31
     6.7.  Subordinate Dependencies  . . . . . . . . . . . . . . . .  31
Show full document text