| < draft-ietf-appsawg-json-pointer-04.txt | draft-ietf-appsawg-json-pointer-05.txt > | |||
|---|---|---|---|---|
| Applications Area Working Group P. Bryan, Ed. | Applications Area Working Group P. Bryan, Ed. | |||
| Internet-Draft Salesforce.com | Internet-Draft Salesforce.com | |||
| Intended status: Informational K. Zyp | Intended status: Informational K. Zyp | |||
| Expires: March 9, 2013 SitePen (USA) | Expires: April 25, 2013 SitePen (USA) | |||
| M. Nottingham, Ed. | M. Nottingham, Ed. | |||
| September 5, 2012 | October 22, 2012 | |||
| JSON Pointer | JSON Pointer | |||
| draft-ietf-appsawg-json-pointer-04 | draft-ietf-appsawg-json-pointer-05 | |||
| Abstract | Abstract | |||
| JSON Pointer defines a string syntax for identifying a specific value | JSON Pointer defines a string syntax for identifying a specific value | |||
| within a JSON document. | within a JSON document. | |||
| 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 | |||
| provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
| skipping to change at page 1, line 33 ¶ | skipping to change at page 1, line 33 ¶ | |||
| 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 March 9, 2013. | This Internet-Draft will expire on April 25, 2013. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2012 IETF Trust and the persons identified as the | Copyright (c) 2012 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 4, line 10 ¶ | skipping to change at page 4, line 10 ¶ | |||
| sequentially evaluated. | sequentially evaluated. | |||
| Evaluation of each reference token begins by decoding any escaped | Evaluation of each reference token begins by decoding any escaped | |||
| character sequence; this is performed by first transforming any | character sequence; this is performed by first transforming any | |||
| occurrence of the sequence '~1' to '/', then transforming any | occurrence of the sequence '~1' to '/', then transforming any | |||
| occurrence of the sequence '~0' to '~'. | occurrence of the sequence '~0' to '~'. | |||
| The reference token then modifies which value is referenced according | The reference token then modifies which value is referenced according | |||
| to the following scheme: | to the following scheme: | |||
| If the currently referenced value is a JSON object, the new | o If the currently referenced value is a JSON object, the new | |||
| referenced value is the object member with the name identified by | referenced value is the object member with the name identified by | |||
| the reference token. The member name is equal to the token if it | the reference token. The member name is equal to the token if it | |||
| has the same number of Unicode characters as token and their code | has the same number of Unicode characters as token and their code | |||
| points are position-wise equal. If a referenced member name is | points are position-wise equal. If a referenced member name is | |||
| not unique in an object, the member that is referenced is | not unique in an object, the member that is referenced is | |||
| undefined, and evaluation fails (see below). | undefined, and evaluation fails (see below). | |||
| If the currently referenced value is a JSON array, the reference | o If the currently referenced value is a JSON array, the reference | |||
| token MUST contain characters that represent an unsigned base-10 | token MUST contain either: | |||
| integer value (possibly with leading zeros), and the new | ||||
| referenced value is the array element with the zero-based index | * characters that represent an unsigned base-10 integer value | |||
| identified by the token. | (possibly with leading zeros), making the new referenced value | |||
| is the array element with the zero-based index identified by | ||||
| the token, or | ||||
| * exactly the single character "-", making the new referenced | ||||
| value the (non-existant) member after the last array element. | ||||
| If a reference token is being evaluated against a JSON document, | If a reference token is being evaluated against a JSON document, | |||
| implementations will evaluate each token against the document's | implementations will evaluate each token against the document's | |||
| contents, and terminate evaluation with an error condition if it | contents, and terminate evaluation with an error condition if it | |||
| fails to resolve a concrete value for any of the JSON pointer's | fails to resolve a concrete value for any of the JSON pointer's | |||
| reference tokens. See Section 7 for details. | reference tokens. See Section 7 for details. | |||
| Note that the use of the "-" character to index an array will always | ||||
| result in such an error; applications of JSON Pointer thus need to | ||||
| specify how it is to be handled, if it is to be useful. | ||||
| 5. JSON String Representation | 5. JSON String Representation | |||
| A JSON Pointer can be represented in a JSON string value. Per | A JSON Pointer can be represented in a JSON string value. Per | |||
| [RFC4627], Section 2.5, all instances of quotation mark '"' (%x22), | [RFC4627], Section 2.5, all instances of quotation mark '"' (%x22), | |||
| reverse solidus '\' (%x5C) and control (%x00-1F) characters MUST be | reverse solidus '\' (%x5C) and control (%x00-1F) characters MUST be | |||
| escaped. | escaped. | |||
| Note that before processing a JSON string as a JSON Pointer, | Note that before processing a JSON string as a JSON Pointer, | |||
| backslash escape sequences must be unescaped. | backslash escape sequences must be unescaped. | |||
| End of changes. 7 change blocks. | ||||
| 10 lines changed or deleted | 19 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||