idnits 2.17.1 draft-pbryan-zyp-json-pointer-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 21, 2011) is 4570 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159) Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force P. Bryan, Ed. 3 Internet-Draft ForgeRock US, Inc. 4 Intended status: Informational K. Zyp 5 Expires: April 23, 2012 SitePen (USA) 6 October 21, 2011 8 JSON Pointer 9 draft-pbryan-zyp-json-pointer-02 11 Abstract 13 JSON Pointer defines a syntax for identifying a specific value within 14 a JSON document. 16 Status of this Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at http://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on April 23, 2012. 33 Copyright Notice 35 Copyright (c) 2011 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (http://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 51 2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . 3 52 3. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 53 4. Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . 3 54 5. Error Handling . . . . . . . . . . . . . . . . . . . . . . . . 4 55 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 4 56 7. Security Considerations . . . . . . . . . . . . . . . . . . . . 4 57 8. Normative References . . . . . . . . . . . . . . . . . . . . . 4 58 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . . 5 59 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 5 61 1. Introduction 63 This specification defines JSON Pointer, a syntax for identifying a 64 specific value within a JSON [RFC4627] text document. The syntax is 65 intended to be expressed in a JSON string value or the URI fragment 66 identifier of a resource that has a JSON representation. 68 2. Conventions 70 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 71 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 72 document are to be interpreted as described in [RFC2119]. 74 This specification expresses syntax rules using ABNF [RFC5234] 75 (Augmented Backus-Naur Form) notation. Additionally, it uses the 76 following rules from URI syntax [RFC3986]: "unreserved" and "pct- 77 encoded". 79 3. Syntax 81 A JSON Pointer is a sequence of zero or more reference tokens, each 82 prefixed by a "/" (%x2F) character. Each reference token is a 83 sequence of unreserved and/or percent-encoded characters, per 84 [RFC3986]. 86 json-pointer = *( "/" reference-token ) 87 reference-token = *( unreserved / pct-encoded ) 89 Characters in reference tokens that are not unreserved SHOULD be 90 percent-encoded, per [RFC3986], and MUST be so encoded as "%2F" if 91 the character is "/" to avoid being interpreted as a reference token 92 prefix. 94 It is an error condition if a JSON Pointer does not conform to this 95 syntax. 97 4. Evaluation 99 Evaluation begins with a reference to the root value of a JSON text 100 document, and completes with a reference to some value within the 101 same document. Each token in the JSON Pointer sequence is evaluated, 102 changing the referenced value according to the following scheme: 104 If the currently referenced value is a JSON object, the new 105 referenced value is the object member with the name identified by the 106 token. 108 If the currently referenced value is a JSON array, the token MUST 109 contain an unsigned base-10 integer value, and the new referenced 110 value is the array element with the zero-based index identified by 111 the token. 113 If a reference token is being evaluated against a concrete JSON text 114 document, the implementation MAY evaluate each token against a 115 concrete value, and terminate evaluation with an error condition if a 116 reference token fails to resolve to a concrete value. If a concrete 117 JSON object contains a referenced member with a non-unique name, 118 which of the matching members is resolved is undefined. 120 5. Error Handling 122 In the event of an error condition, evaluation of the JSON Pointer 123 fails to complete. 125 6. IANA Considerations 127 This draft includes no request to IANA. 129 7. Security Considerations 131 A pointer is not guaranteed to resolve to a JSON value. 132 Implementations of JSON Pointer should be aware of this and take 133 appropriate precautions. 135 8. Normative References 137 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 138 Requirement Levels", BCP 14, RFC 2119, March 1997. 140 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 141 Resource Identifier (URI): Generic Syntax", STD 66, 142 RFC 3986, January 2005. 144 [RFC4627] Crockford, D., "The application/json Media Type for 145 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 147 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 148 Specifications: ABNF", STD 68, RFC 5234, January 2008. 150 Appendix A. Examples 152 The following examples illustrate the use of JSON pointers in URI 153 fragments for a JSON text document located at 154 http://example.com/example.json, with the following value: 156 { 157 "foo": { 158 "bar": [ "element0", "element1" ], 159 "inner object": { 160 "baz": "qux" 161 } 162 } 164 http://example.com/example.json# 165 Resolves to the object value at the root of the JSON text 166 document. 168 http://example.com/example.json#/foo 169 Resolves to the object value of the "foo" member in the root 170 object. 172 http://example.com/example.json#/foo/inner%20object 173 Resolves to the object value of the "inner object" member in the 174 "foo" object value in the root object. 176 http://example.com/example.json#/foo/inner%20object/baz 177 Resolves to the string value "qux", which is the value of the 178 "baz" member in the "inner object" member in the "foo" member in 179 the root object. 181 http://example.com/example.json#/foo/bar/0 182 Resolves to the string value "element0", which is the first value 183 in the "bar" array in the "foo" member in the root object. 185 Authors' Addresses 187 Paul C. Bryan (editor) 188 ForgeRock US, Inc. 189 201 NE Park Plaza Drive Suite 196 190 Vancouver, WA 98684 191 USA 193 Phone: +1 604 783 1481 194 Email: paul.bryan@forgerock.com 195 Kris Zyp 196 SitePen (USA) 197 530 Lytton Avenue 198 Palo Alto, CA 94301 199 USA 201 Phone: +1 650 968 8787 202 Email: kris@sitepen.com