idnits 2.17.1 draft-jsonorg-json-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 18. -- Found old boilerplate from RFC 3978, Section 5.5 on line 320. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 297. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 304. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 310. ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 1) being 328 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- The document has an RFC 3978 Section 5.2(a) Derivative Works Limitation clause. == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 209 has weird spacing: '... form for...' -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- Couldn't find a document date in the document -- date freshness check skipped. Checking references for intended status: Informational ---------------------------------------------------------------------------- No issues found here. Summary: 3 errors (**), 0 flaws (~~), 3 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 JSON D. Crockford 2 Internet Draft JSON.org 3 draft-jsonorg-json-00.txt January, 2006 4 Intended status: Informational 5 Expires: June 10, 2006 7 JSON 9 Status of this Memo 11 This document may not be modified, and derivative works of it 12 may not be created, except to publish it as an RFC and to 13 translate it into languages other than English. 15 By submitting this Internet-Draft, each author represents that any 16 applicable patent or other IPR claims of which he or she is aware 17 have been or will be disclosed, and any of which he or she becomes 18 aware will be disclosed, in accordance with Section 6 of BCP 79. 20 Internet-Drafts are working documents of the Internet Engineering 21 Task Force (IETF), its areas, and its working groups. Note that 22 other groups may also distribute working documents as 23 Internet-Drafts. 25 Internet-Drafts are draft documents valid for a maximum of six months 26 and may be updated, replaced, or obsoleted by other documents at any 27 time. It is inappropriate to use Internet-Drafts as reference 28 material or to cite them other than as "work in progress." 30 The list of current Internet-Drafts can be accessed at 31 http://www.ietf.org/ietf/1id-abstracts.txt. 33 The list of Internet-Draft Shadow Directories can be accessed at 34 http://www.ietf.org/shadow.html. 36 This Internet Draft will expire on June 10, 2006. 38 Copyright Notice 40 Copyright (C) The Internet Society (2006). 42 Abstract 44 JSON (JavaScript Object Notation) is a light-weight, text-based, 45 language-independent, data interchange format. It was derived from 46 ECMA 262 (The ECMAScript Programming Language Standard), Third 47 Edition. JSON defines a small set of formatting rules for the 48 portable representation of structured data. 50 Conventions used in this document 52 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 53 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 54 document are to be interpreted as described in RFC-2119. 56 The syntax diagrams in this document are to be interpreted as 57 described in RFC-2234. 59 1. Introduction 61 JSON, or JavaScript Object Notation, is a text format for the 62 serialization of structured data. It is derived from the object 63 literals of JavaScript, as defined in ECMA 262 (The ECMAScript 64 Programming Language Standard), Third Edition (1999). 66 JSON can represent four primitive types (strings, numbers, booleans, 67 and null) and two structured types (objects and arrays). 69 A string is a sequence of zero or more Unicode characters. 71 An object is an unordered collection of zero or more name/value 72 pairs, where a name is a string, and a value is a string, number, 73 boolean, null, object, or array. 75 An array is an ordered sequence of zero or more values. 77 The terms "object" and "array" come from the conventions of 78 JavaScript. 80 2. JSON Grammar 82 A JSON text is a sequence of tokens. The set of tokens includes six 83 structural characters, strings, numbers, and three literal names. 85 These are the six structural characters: 87 = %x7B ; { left brace 89 = %x7D ; } right brace 91 = %x5B ; [ left bracket 93 = %x5D ; ] right brace 95 = %x3A ; : colon 97 = %x2C ; , comma 99 2.1. Whitespace 101 The tokens may be separated by any combination of these whitespace 102 characters: 104 space U+0020 Space 105 TAB U+0009 Horizontal tab 106 LF U+000A Line feed or New line 107 CR U+000D Carriage return 109 Insignificant whitespace must not be placed within a 110 multicharacter token (a literal name, number, or string). A space 111 character in a string is significant. 113 2.2. Values 115 A JSON value can be a object, array, number, or string, or one of 116 the literal names true, false, or null. The literal names must be 117 in lower case. No other literal names are allowed. 119 = / / / / 120 / / 122 = %x74.72.75.65 ; true 124 = %x66.61.6c.73.65 ; false 126 = %x6e.75.6c.6c ; null 128 2.3. Objects 130 An object structure is represented as a pair of curly braces 131 surrounding zero or more name/value pairs (or members). A name is 132 a string. A single colon comes after each name, separating the 133 name from the value. A single comma separates a value from a 134 following name. 136 = [ 137 *( ) ] 139 = 141 2.4. Arrays 143 An array structure is represented as square brackets surrounding 144 zero or more values (or elements). Elements are separated by 145 commas. 147 = [ 148 *( ) ] 150 2.5. Numbers 152 The representation of numbers is similar to that used in 153 programming languages. A number contains an integer component 154 (which may be prefixed with an optional minus sign (U+002D)), 155 which may be followed by a fraction part and/or an exponent part. 157 Octal and hex forms are not allowed. Leading zeros are not allowed 158 as that could lead to confusion. 160 A fraction part is a decimal point (U+002E) followed by one or 161 more digits. 163 An exponent part begins with the letter E in upper or lower case 164 (U+0045 or U+0065), which may be followed by a plus (U+002B) or 165 minus (U+002D). The E and optional sign are followed by one or 166 more digits. 168 Numeric values that cannot be represented as sequences of digits 169 (such as Infinity and NaN) are not permitted. 171 = [ "-" ] [ ] [ ] 173 = "0" / ( * ) 175 = "." 1* 177 = ( "e" / "E" ) [ "-" / "+" ] 1* 179 = "0" / "1" / "2" / "3" / "4" / 180 "5" / "6" / "7" / "8" / "9" 182 = "1" / "2" / "3" / "4" / 183 "5" / "6" / "7" / "8" / "9" 185 2.6. Strings 187 The representation of strings is similar to conventions used in 188 the C family of programming languages. A string begins and ends 189 with quotation marks (U+0022). All Unicode characters can be 190 placed within the quotation marks except for the characters which 191 must be escaped: quotation mark (U+0022), reverse virgule 192 (U+005C), and the control characters (U+0000 through U+001F). 194 Any character may be escaped. If the character is in the Basic 195 Multilingual Plane (U+0000 through U+FFFF) then it may be 196 represented as a six-character sequence: a reverse virgule 197 followed by the lower case letter u (U+0075) followed by four 198 hexadecimal digits which encode the character's code point. The 199 hexadecimal letters a though f can be in upper or lower case. So, 200 for example, a string containing only a single reverse virgule 201 character may be represented as "\u005C". 203 Alternatively, there are two-character sequence escape 204 representations of some popular characters. So, for example, a 205 string containing only a single reverse virgule character may be 206 represented more compactly as "\\". 208 Short Long 209 form form 210 \" \u0022 quotation mark 211 \\ \u005C reverse virgule or backslash 212 \/ \u002F virgule or slash 213 \b \u0008 backspace 214 \f \u000C form feed 215 \n \u000A line feed or new line 216 \r \u000D carriage return 217 \t \u0009 tab 219 To escape an extended character that is not in the Basic 220 Multilingual Plane, then the character is represented as a 221 twelve-character sequence, encoding the UTF-16 surrogate pair. So, 222 for example, a string containing only the G clef character 223 (U+1D11E) may be represented as "\uD834\uDD1E". 225 A space in a string is treated as a space character, not as 226 insignificant whitespace. 228 = * 230 = %x22 ; " 232 = %x5C ; \ 234 = 235 / 236 ( 237 %x22 / ; " quotation mark 238 %x5C / ; \ reverse virgule 239 %x2F / ; / virgule 240 %x62 / ; b backspace 241 %x66 / ; f form feed 242 %x6E / ; n line feed 243 %x72 / ; r carriage return 244 %x74 / ; t tab 245 %x75 4 ) ; uXXXX 247 = / "a" / "b" / "c" / "d" / "e" / "f" / 248 "A" / "B" / "C" / "D" / "E" / "F" 250 = %x20-21 / %x23-5B / %x5D-10FFFF 252 3. Parsers 254 A JSON parser transforms a JSON text into another representation. A 255 JSON parser MUST accept all texts that conform to the JSON grammar. 256 A JSON parser MAY accept non-JSON forms or extensions. 258 An implementation may set limits on the size of texts that it 259 accepts. An implementation may set limits on the maximum depth of 260 nesting. An implementation may set limits on the range of numbers. 261 An implementation may set limits on the length and character contents 262 of strings. 264 4. Generators 266 A JSON generator produces JSON text. The resulting text MUST strictly 267 conform to the JSON grammar. 269 5. IANA Considerations 271 The MIME media type for JSON text is text/json. 273 6. Security Considerations 275 Since JSON is a subset of JavaScript, the eval() function (which 276 compiles and execute a text) can be used as a JSON parser. This 277 should only done if the text is known to be safe. A regular 278 expression can be used to prove that the text contains only JSON 279 tokens. A text containing only JSON tokens is safe to eval because 280 the JSON subset of JavaScript is safe. 282 Author's Address 284 Douglas Crockford 285 JSON.org 286 Contact Email: douglas@crockford.com 288 Intellectual Property Statement 290 The IETF takes no position regarding the validity or scope of any 291 Intellectual Property Rights or other rights that might be claimed to 292 pertain to the implementation or use of the technology described in 293 this document or the extent to which any license under such rights 294 might or might not be available; nor does it represent that it has 295 made any independent effort to identify any such rights. Information 296 on the procedures with respect to rights in RFC documents can be 297 found in BCP 78 and BCP 79. 299 Copies of IPR disclosures made to the IETF Secretariat and any 300 assurances of licenses to be made available, or the result of an 301 attempt made to obtain a general license or permission for the use of 302 such proprietary rights by implementers or users of this 303 specification can be obtained from the IETF on-line IPR repository at 304 http://www.ietf.org/ipr. 306 The IETF invites any interested party to bring to its attention any 307 copyrights, patents or patent applications, or other proprietary 308 rights that may cover technology that may be required to implement 309 this standard. Please address the information to the IETF at ietf- 310 ipr@ietf.org. 312 Disclaimer of Validity 314 This document and the information contained herein are provided on an 315 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 316 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 317 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 318 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 319 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 320 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 322 Copyright Statement 324 Copyright (C) The Internet Society (2006). This document is subject 325 to the rights, licenses and restrictions contained in BCP 78, and 326 except as set forth therein, the authors retain all their rights. 328 This Internet-Draft will expire on June 10, 2006.