draft-ietf-json-i-json-03.txt   draft-ietf-json-i-json-04.txt 
Network Working Group T. Bray, Ed. Network Working Group T. Bray, Ed.
Internet-Draft Textuality Services Internet-Draft Textuality Services
Intended status: Standards Track August 5, 2014 Intended status: Standards Track November 26, 2014
Expires: February 6, 2015 Expires: May 30, 2015
The I-JSON Message Format The I-JSON Message Format
draft-ietf-json-i-json-03 draft-ietf-json-i-json-04
Abstract Abstract
I-JSON is a restricted profile of JSON designed to maximize I-JSON is a restricted profile of JSON designed to maximize
interoperability and increase confidence that software can process it interoperability and increase confidence that software can process it
successfully with predictable results. successfully with predictable results.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
skipping to change at page 1, line 32 skipping to change at page 1, line 32
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on February 6, 2015. This Internet-Draft will expire on May 30, 2015.
Copyright Notice Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the Copyright (c) 2014 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 3, line 32 skipping to change at page 3, line 32
Software which implements IEEE 754-2008 binary64 (double precision) Software which implements IEEE 754-2008 binary64 (double precision)
numbers [IEEE754] is generally available and widely used. numbers [IEEE754] is generally available and widely used.
Implementations which generate I-JSON messages MUST NOT assume that Implementations which generate I-JSON messages MUST NOT assume that
receiving implementations can process numeric values with greater receiving implementations can process numeric values with greater
magnitude or precision than provided by those numbers. I-JSON magnitude or precision than provided by those numbers. I-JSON
messages SHOULD NOT include numbers which express greater magnitude messages SHOULD NOT include numbers which express greater magnitude
or precision than an IEEE 754 double precision number provides, for or precision than an IEEE 754 double precision number provides, for
example 1E400 or 3.141592653589793238462643383279. example 1E400 or 3.141592653589793238462643383279.
In particular, an I-JSON sender MUST NOT expect a receiver to treat In particular, an I-JSON sender cannot expect a receiver to treat an
an integer whose absolute value is greater than 9007199254740991 integer whose absolute value is greater than 9007199254740991 (i.e.,
(i.e., that is outside the range [-(2**53)+1, (2**53)-1]) as an exact that is outside the range [-(2**53)+1, (2**53)-1]) as an exact value.
value.
For applications which require the exact interchange of numbers with For applications which require the exact interchange of numbers with
greater magnitude or precision (one example would be 64-bit greater magnitude or precision (one example would be 64-bit
integers), it is RECOMMENDED to encode them in JSON string values. integers), it is RECOMMENDED to encode them in JSON string values.
This requires that the receiving program understand the intended This requires that the receiving program understand the intended
semantic of the value. semantic of the value.
2.3. Object constraints 2.3. Object constraints
Objects in I-JSON messages MUST NOT have members with duplicate Objects in I-JSON messages MUST NOT have members with duplicate
names. In this context, "duplicate" means that the names, after names. In this context, "duplicate" means that the names, after
processing any escaped characters, are identical sequences of Unicode processing any escaped characters, are identical sequences of Unicode
characters. characters.
Implementations which generate I-JSON messages MUST NOT assume that The order of object members in an I-JSON message does not change the
the order of object members in those messages is available to meaning of an I-JSON message. A receiving implementation MAY treat
software which receives them. two I-JSON messages as equivalent if they differ only in the order of
the object members.
3. Software Behavior 3. Software Behavior
When software reads data which it expects to be an I-JSON message, When software reads data which it expects to be an I-JSON message,
but the data violates one of the MUST constraints in the previous but the data violates one of the MUST constraints in the previous
section (for example, contains an object with a duplicate key, or a section (for example, contains an object with a duplicate key, or a
UTF-8 encoding error), that software MUST NOT trust nor act on the UTF-8 encoding error), that software MUST NOT trust nor act on the
content of the message. content of the message.
Designers of protocols which use I-JSON messages SHOULD provide a Designers of protocols which use I-JSON messages SHOULD provide a
skipping to change at page 4, line 27 skipping to change at page 4, line 27
4. Protocol-design Recommendations 4. Protocol-design Recommendations
I-JSON is designed for use in Internet protocols. The following I-JSON is designed for use in Internet protocols. The following
recommendations apply to the use of I-JSON in such protocols. recommendations apply to the use of I-JSON in such protocols.
4.1. Top-level Constructs 4.1. Top-level Constructs
An I-JSON message can be any JSON value. However, there are software An I-JSON message can be any JSON value. However, there are software
implementations, coded to the older [RFC4627] specification, which implementations, coded to the older [RFC4627] specification, which
only accept JSON objects or JSON arrays at the top level of JSON only accept JSON objects or JSON arrays at the top level of JSON
texts. For maximum interoperability with such implementations, it is texts. For maximum interoperability with such implementations,
RECOMMENDED that protocol designers avoid the use of top-level JSON protocol designers SHOULD NOT use top-level JSON texts which are
texts which are neither objects nor arrays. neither objects nor arrays.
4.2. Must-ignore Policy 4.2. Must-ignore Policy
It is frequently the case that changes to protocols are required It is frequently the case that changes to protocols are required
after they have been put in production. Protocols which allow the after they have been put in production. Protocols which allow the
introduction of new protocol elements in a way that does not disrupt introduction of new protocol elements in a way that does not disrupt
the operation of existing software have proven advantageous in the operation of existing software have proven advantageous in
practice. practice.
Such a policy is often referred to as "Must-Ignore" and is expressed This can be referred to as a "Must-Ignore" policy, meaning that when
with language such as "When receiving software encounters a protocol an implementation encounters a protocol element which it does not
element which it does not recognize, it MUST NOT change its behavior recognize, it should treat the rest of the protocol transaction as if
as a consequence, and in particular must not fail." The converse the new element simply did not appear, and in particular MUST NOT
policy, often referred to as "Must-Understand", does not tolerate the treat this as an error condition. The converse "Must-Understand"
introduction of new protocol elements, and while this has proven policy does not tolerate the introduction of new protocol elements,
necessary in certain protocol designs, in general it has been found and while this has proven necessary in certain protocol designs, in
to be overly restrictive and brittle. general it has been found to be overly restrictive and brittle.
A good way to support the use of Must-Ignore in I-JSON protocol A good way to support the use of Must-Ignore in I-JSON protocol
designs is to require that top-level protocol elements must be JSON designs is to require that top-level protocol elements must be JSON
objects, and to specify that members whose names are unrecognized objects, and to specify that members whose names are unrecognized
MUST NOT produce behavior changes. MUST be ignored.
4.3. Time and Date Handling 4.3. Time and Date Handling
Protocols often contain data items which are designed to contain Protocols often contain data items which are designed to contain
timestamps or time durations. It is RECOMMENDED that all such data timestamps or time durations. It is RECOMMENDED that all such data
items be expressed as string values in in ISO 8601 format, as items be expressed as string values in in ISO 8601 format, as
specified in [RFC3339], with the additional restriction that specified in [RFC3339], with the additional restriction that
uppercase rather than lowercase letters be used. It is also uppercase rather than lowercase letters be used. It is also
RECOMMENDED that all data items containing time durations conform to RECOMMENDED that all data items containing time durations conform to
the "duration" production in Appendix A of RFC3339, with the same the "duration" production in Appendix A of RFC3339, with the same
 End of changes. 8 change blocks. 
23 lines changed or deleted 23 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/