draft-ietf-json-i-json-05.txt   draft-ietf-json-i-json-06.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 December 18, 2014 Intended status: Standards Track January 27, 2015
Expires: June 21, 2015 Expires: July 31, 2015
The I-JSON Message Format The I-JSON Message Format
draft-ietf-json-i-json-05 draft-ietf-json-i-json-06
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 June 21, 2015. This Internet-Draft will expire on July 31, 2015.
Copyright Notice Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the Copyright (c) 2015 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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
skipping to change at page 3, line 15 skipping to change at page 3, line 15
2. I-JSON Messages 2. I-JSON Messages
An I-JSON message is a JSON text, as defined by RFC 7159. An I-JSON message is a JSON text, as defined by RFC 7159.
2.1. Encoding and Characters 2.1. Encoding and Characters
I-JSON messages MUST be encoded using UTF-8 [RFC3629]. I-JSON messages MUST be encoded using UTF-8 [RFC3629].
Object member names, and string values in arrays and object members, Object member names, and string values in arrays and object members,
MUST NOT include code points which identify Surrogates or MUST NOT include code points which identify Surrogates or
Noncharacters. Noncharacters [UNICODE] (Section 2.4).
This applies both to characters encoded directly in UTF-8 and to This applies both to characters encoded directly in UTF-8 and to
those which are escaped; thus, "\uDEAD" is invalid because it is an those which are escaped; thus, "\uDEAD" is invalid because it is an
unpaired surrogate, while "\uD800\uDEAD" would be legal. unpaired surrogate, while "\uD800\uDEAD" would be legal.
2.2. Numbers 2.2. Numbers
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 cannot assume that Implementations which generate I-JSON messages cannot 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 cannot expect a receiver to treat an An I-JSON sender cannot expect a receiver to treat an integer whose
integer whose absolute value is greater than 9007199254740991 (i.e., absolute value is greater than 9007199254740991 (i.e., that is
that is outside the range [-(2**53)+1, (2**53)-1]) as an exact value. outside the range [-(2**53)+1, (2**53)-1]) as an exact 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, it is RECOMMENDED to encode them in
integers), it is RECOMMENDED to encode them in JSON string values. JSON string values. This requires that the receiving program
This requires that the receiving program understand the intended understand the intended semantic of the value. An example would be
semantic of the value. 64-bit integers, even though modern hardware can deal with them,
because of the limited scope of JavaScript numbers.
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.
The order of object members in an I-JSON message does not change the The order of object members in an I-JSON message does not change the
meaning of an I-JSON message. A receiving implementation MAY treat meaning of an I-JSON message. A receiving implementation MAY treat
two I-JSON messages as equivalent if they differ only in the order of two I-JSON messages as equivalent if they differ only in the order of
the object members. the object members.
3. Software Behavior 3. Software Behavior
A major advantage of using I-JSON is that receivers can avoid A major advantage of using I-JSON is that receivers can avoid
ambiguous semantics in the JSON messages it receives. This allows ambiguous semantics in the JSON messages they receive. This allows
receivers to reject or otherwise disregard messages which do not receivers to reject or otherwise disregard messages which do not
conform to the requirements in this document for I-JSON messages. conform to the requirements in this document for I-JSON messages.
Protocols that use I-JSON message can be written so that receiving Protocols that use I-JSON message can be written so that receiving
implementation are required to reject (or, as in the case of security implementations are required to reject (or, as in the case of
protocols, not trust) messages that do not satisfy the constraints of security protocols, not trust) messages that do not satisfy the
I-JSON. constraints of I-JSON.
Designers of protocols which use I-JSON messages SHOULD provide a Designers of protocols which use I-JSON messages SHOULD provide a
way, in this case, for the receiver of the erroneous data to signal way, in this case, for the receiver of the erroneous data to signal
the problem to the sender. the problem to the sender.
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.
skipping to change at page 5, line 11 skipping to change at page 5, line 14
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 be ignored. 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 ISO 8601 format, as specified
specified in [RFC3339], with the additional restriction that in [RFC3339], with the additional restrictions that uppercase rather
uppercase rather than lowercase letters be used. It is also than lowercase letters be used, that the timezone be included not
RECOMMENDED that all data items containing time durations conform to defaulted, and that optional trailing seconds be included even when
the "duration" production in Appendix A of RFC3339, with the same their value is "00". It is also RECOMMENDED that all data items
additional restriction. containing time durations conform to the "duration" production in
Appendix A of RFC3339, with the same additional restrictions.
4.4. Binary Data 4.4. Binary Data
When it is required that an I-JSON protocol element contain arbitrary When it is required that an I-JSON protocol element contain arbitrary
binary data, it is RECOMMENDED that this data be encoded in a string binary data, it is RECOMMENDED that this data be encoded in a string
value in base64url; see Section 5 of [RFC4648]. value in base64url; see Section 5 of [RFC4648].
5. Acknowledgements 5. Acknowledgements
I-JSON is entirely dependent on the design of JSON, largely due to I-JSON is entirely dependent on the design of JSON, largely due to
Douglas Crockford. The specifics were strongly influenced by the Douglas Crockford. The specifics were strongly influenced by the
contributors to the design of RFC 7159 on the IETF JSON Working contributors to the design of RFC 7159 on the IETF JSON Working
Group. Group.
6. Security Considerations 6. Security Considerations
All the security considerations which apply to JSON (see RFC 7159) All the security considerations which apply to JSON (see RFC 7159)
apply to I-JSON. There are no additional security considerations apply to I-JSON. There are no additional security considerations
specific to I-JSON. specific to I-JSON.
Since I-JSON forbids the use of certain JSON idioms that can lead to
unpredictable behavior in receiving software, it may prove a more
secure basis for Internet protocols, and may be a good choice for
protocol designers with special security needs.
7. Normative References 7. Normative References
[IEEE754] IEEE, "IEEE Standard for Floating-Point Arithmetic", 2008, [IEEE754] IEEE, "IEEE Standard for Floating-Point Arithmetic", 2008,
<http://grouper.ieee.org/groups/754/>. <http://grouper.ieee.org/groups/754/>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3339] Klyne, G., Ed. and C. Newman, "Date and Time on the [RFC3339] Klyne, G., Ed. and C. Newman, "Date and Time on the
Internet: Timestamps", RFC 3339, July 2002. Internet: Timestamps", RFC 3339, July 2002.
skipping to change at page 6, line 14 skipping to change at page 6, line 20
[RFC4627] Crockford, D., "The application/json Media Type for [RFC4627] Crockford, D., "The application/json Media Type for
JavaScript Object Notation (JSON)", RFC 4627, July 2006. JavaScript Object Notation (JSON)", RFC 4627, July 2006.
[RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data
Encodings", RFC 4648, October 2006. Encodings", RFC 4648, October 2006.
[RFC7159] Bray, T., "The JavaScript Object Notation (JSON) Data [RFC7159] Bray, T., "The JavaScript Object Notation (JSON) Data
Interchange Format", RFC 7159, March 2014. Interchange Format", RFC 7159, March 2014.
[UNICODE] The Unicode Consortium, "The Unicode Standard", 2003-,
<http://www.unicode.org/versions/latest/>.
Note that this reference is to the latest version of
Unicode, rather than to a specific release. It is not
expected that future changes in the UNICODE specification
will affect the referenced classifications.
Author's Address Author's Address
Tim Bray (editor) Tim Bray (editor)
Textuality Services Textuality Services
Email: tbray@textuality.com Email: tbray@textuality.com
URI: https://www.tbray.org/ URI: https://www.tbray.org/
 End of changes. 12 change blocks. 
23 lines changed or deleted 38 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/