JSON Template Language
draft-jonas-json-template-language-01

Document Type Active Internet-Draft (individual)
Last updated 2019-03-29
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                                           S. Jonas
Internet-Draft                                             ETC Labs Core
Intended status: Informational                            March 29, 2019
Expires: September 30, 2019

                         JSON Template Language
                 draft-jonas-json-template-language-01

Abstract

   JSON Template Language is a simple, compact template language to
   substitute JSON [1] into a template.  It is derived from the template
   literals of Javascript, as defined in the ECMAScript Programming
   Language Standard, Ninth Edition ECMA-262 [2].  It has uses not
   limited to: specifying interfaces, runtime expression mapping, and
   other forms of programmatically interacting with JSON and templates.

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 30, 2019.

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

Jonas                  Expires September 30, 2019               [Page 1]
Internet-Draft               JSON Templates                   March 2019

   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Conventions and Definitions . . . . . . . . . . . . . . . . .   2
   3.  Security Considerations . . . . . . . . . . . . . . . . . . .   3
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   3
   5.  Example Usage . . . . . . . . . . . . . . . . . . . . . . . .   3
     5.1.  Accessing Array indicies  . . . . . . . . . . . . . . . .   3
     5.2.  Accessing Nested Objects and Arrays . . . . . . . . . . .   4
   6.  JSON Template Grammar . . . . . . . . . . . . . . . . . . . .   4
     6.1.  Template literal  . . . . . . . . . . . . . . . . . . . .   5
     6.2.  Identifier  . . . . . . . . . . . . . . . . . . . . . . .   5
     6.3.  Path  . . . . . . . . . . . . . . . . . . . . . . . . . .   5
     6.4.  Array Index . . . . . . . . . . . . . . . . . . . . . . .   5
     6.5.  Head  . . . . . . . . . . . . . . . . . . . . . . . . . .   6
     6.6.  Tail  . . . . . . . . . . . . . . . . . . . . . . . . . .   6
   7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   6
     7.1.  Normative References  . . . . . . . . . . . . . . . . . .   6
     7.2.  URIs  . . . . . . . . . . . . . . . . . . . . . . . . . .   6
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   7

1.  Introduction

   JSON Template Language provides a mechanism for describing various
   parts of a template by using familiar syntax from Javascript and
   JSON.  By using a familiar syntax we can get interoperability within
   the JSON [3] and URI [4] specifications.

   The terms "string", "object" and "array" are from the conventions of
   Javascript and JSON.

   A JSON Template provides a structural description of a template, and
   when JSON is provided, machine-readable instructions on how to
   construct a string corresponding to those values.  A template is
   transformed into a string by replacing each of the template literals
   with the corresponding JSON values.

2.  Conventions and Definitions

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in BCP
   14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

Jonas                  Expires September 30, 2019               [Page 2]
Internet-Draft               JSON Templates                   March 2019

3.  Security Considerations

   When considering runtime security of JSON Template Language, the
   surface area is only expanding JSON value by key.  No loops or
Show full document text