JSON Constrained Notation (JSCN)
draft-miller-json-constrained-notation-00

Document Type Active Internet-Draft (individual)
Last updated 2017-05-18
Stream (None)
Intended RFC status (None)
Formats plain text 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                                          J. Miller
Internet-Draft
Intended status: Standards Track                          P. Saint-Andre
Expires: November 19, 2017                                      Filament
                                                            May 18, 2017

                    JSON Constrained Notation (JSCN)
               draft-miller-json-constrained-notation-00

Abstract

   This specification addresses the challenges of using JavaScript
   Object Notation (JSON) with constrained devices by providing a
   standard set of mapping rules to Concise Binary Object Representation
   (CBOR) that preserve all semantic information, such that the original
   JSON string can be identically re-created.  JSON Constrained Notation
   can also be used by devices as a native data format, which can then
   be represented as JSON when necessary for diagnostics, compatibility,
   and ease of integration with higher-level systems.

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 November 19, 2017.

Copyright Notice

   Copyright (c) 2017 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

Miller & Saint-Andre    Expires November 19, 2017               [Page 1]
Internet-Draft                    JSCN                          May 2017

   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  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   4
   2.  CBOR Encoding . . . . . . . . . . . . . . . . . . . . . . . .   4
     2.1.  Structured Types  . . . . . . . . . . . . . . . . . . . .   4
     2.2.  Primitive Types . . . . . . . . . . . . . . . . . . . . .   5
       2.2.1.  Boolean and Null  . . . . . . . . . . . . . . . . . .   5
       2.2.2.  Numbers . . . . . . . . . . . . . . . . . . . . . . .   5
       2.2.3.  Strings . . . . . . . . . . . . . . . . . . . . . . .   5
   3.  Reference Sets  . . . . . . . . . . . . . . . . . . . . . . .   6
   4.  Canonical Form  . . . . . . . . . . . . . . . . . . . . . . .   7
     4.1.  Formatting-only Whitespace  . . . . . . . . . . . . . . .   7
     4.2.  String Escapes  . . . . . . . . . . . . . . . . . . . . .   9
   5.  Constrained API . . . . . . . . . . . . . . . . . . . . . . .  10
   6.  Examples  . . . . . . . . . . . . . . . . . . . . . . . . . .  10
     6.1.  JSON  . . . . . . . . . . . . . . . . . . . . . . . . . .  10
       6.1.1.  Input . . . . . . . . . . . . . . . . . . . . . . . .  10
       6.1.2.  Optimized JSCN Encoding . . . . . . . . . . . . . . .  11
       6.1.3.  Un-optimized JSCN Encoding  . . . . . . . . . . . . .  13
     6.2.  JSON Web Token  . . . . . . . . . . . . . . . . . . . . .  15
   7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  16
     7.1.  CBOR Tags . . . . . . . . . . . . . . . . . . . . . . . .  16
     7.2.  JSCN Reference Sets Registry  . . . . . . . . . . . . . .  17
   8.  Security Considerations . . . . . . . . . . . . . . . . . . .  17
   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  17
     9.1.  Normative References  . . . . . . . . . . . . . . . . . .  17
     9.2.  Informative References  . . . . . . . . . . . . . . . . .  18
     9.3.  URIs  . . . . . . . . . . . . . . . . . . . . . . . . . .  18
   Appendix A.  Acknowledgements . . . . . . . . . . . . . . . . . .  18
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  19

1.  Introduction

   Although JavaScript Object Notation (JSON) [RFC7159] has been widely
   adopted in traditional networking and software environments, its use
Show full document text