Initial commit
[yaffs-website] / node_modules / json-schema / draft-zyp-json-schema-03.xml
1 <?xml version="1.0" encoding="US-ASCII"?>\r
2 <!DOCTYPE rfc SYSTEM "rfc2629.dtd" [\r
3 <!ENTITY rfc4627 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4627.xml">\r
4 <!ENTITY rfc3986 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml">\r
5 <!ENTITY rfc2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">\r
6 <!ENTITY rfc4287 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4287.xml">\r
7 <!ENTITY rfc2616 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2616.xml">\r
8 <!ENTITY rfc3339 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3339.xml">\r
9 <!ENTITY rfc2045 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2045.xml">\r
10 <!ENTITY rfc5226 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml">\r
11 <!ENTITY rfc2396 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2396.xml">\r
12 <!ENTITY iddiscovery SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.hammer-discovery.xml">\r
13 <!ENTITY uritemplate SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.gregorio-uritemplate.xml">\r
14 <!ENTITY linkheader SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.nottingham-http-link-header.xml">\r
15 <!ENTITY html401 SYSTEM "http://xml.resource.org/public/rfc/bibxml4/reference.W3C.REC-html401-19991224.xml">\r
16 <!ENTITY css21 SYSTEM "http://xml.resource.org/public/rfc/bibxml4/reference.W3C.CR-CSS21-20070719.xml">\r
17 ]>\r
18 <?rfc toc="yes"?>\r
19 <?rfc symrefs="yes"?>\r
20 <?rfc compact="yes"?>\r
21 <?rfc subcompact="no"?>\r
22 <?rfc strict="no"?>\r
23 <?rfc rfcedstyle="yes"?>\r
24 <rfc category="info" docName="draft-zyp-json-schema-03" ipr="trust200902">\r
25         <front>\r
26                 <title abbrev="JSON Schema Media Type">A JSON Media Type for Describing the Structure and Meaning of JSON Documents</title>\r
27                 \r
28                 <author fullname="Kris Zyp" initials="K" role="editor" surname="Zyp">\r
29                         <organization>SitePen (USA)</organization>\r
30                         <address>\r
31                                 <postal>\r
32                                         <street>530 Lytton Avenue</street>\r
33                                         <city>Palo Alto, CA 94301</city>\r
34                                         <country>USA</country>\r
35                                 </postal>\r
36                                 <phone>+1 650 968 8787</phone>\r
37                                 <email>kris@sitepen.com</email>\r
38                         </address>\r
39                 </author>\r
40                 \r
41                 <author fullname="Gary Court" initials="G" surname="Court">\r
42                         <address>\r
43                                 <postal>\r
44                                         <street></street>\r
45                                         <city>Calgary, AB</city>\r
46                                         <country>Canada</country>\r
47                                 </postal>\r
48                                 <email>gary.court@gmail.com</email>\r
49                         </address>\r
50                 </author>\r
51                 \r
52                 <date year="2011" />\r
53                 <workgroup>Internet Engineering Task Force</workgroup>\r
54                 <keyword>JSON</keyword>\r
55                 <keyword>Schema</keyword>\r
56                 <keyword>JavaScript</keyword>\r
57                 <keyword>Object</keyword>\r
58                 <keyword>Notation</keyword>\r
59                 <keyword>Hyper Schema</keyword>\r
60                 <keyword>Hypermedia</keyword>\r
61                 \r
62                 <abstract>\r
63                         <t>\r
64                                 JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", \r
65                                 a JSON based format for defining \r
66                                 the structure of JSON data. JSON Schema provides a contract for what JSON \r
67                                 data is required for a given application and how to interact with it. JSON \r
68                                 Schema is intended to define validation, documentation, hyperlink \r
69                                 navigation, and interaction control of JSON data. \r
70                         </t>\r
71                 </abstract>\r
72         </front>\r
73         \r
74         <middle>\r
75                 <section title="Introduction">\r
76                         <t>\r
77                                 JSON (JavaScript Object Notation) Schema is a JSON media type for defining \r
78                                 the structure of JSON data. JSON Schema provides a contract for what JSON \r
79                                 data is required for a given application and how to interact with it. JSON \r
80                                 Schema is intended to define validation, documentation, hyperlink \r
81                                 navigation, and interaction control of JSON data. \r
82                         </t>\r
83                 </section>\r
84                 \r
85                 <section title="Conventions">\r
86                         <t>\r
87                                 <!-- The text in this section has been copied from the official boilerplate, \r
88                                 and should not be modified.-->\r
89                                 \r
90                                 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", \r
91                                 "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be\r
92                                 interpreted as described in <xref target="RFC2119">RFC 2119</xref>.\r
93                         </t>\r
94                 </section>\r
95                 \r
96                 <!-- ********************************************* -->\r
97                 \r
98                 <section title="Overview">\r
99                         <t>\r
100                                 JSON Schema defines the media type "application/schema+json" for \r
101                                 describing the structure of other\r
102                                 JSON documents. JSON Schema is JSON-based and includes facilities \r
103                                 for describing the structure of JSON documents in terms of\r
104                                 allowable values, descriptions, and interpreting relations with other resources.\r
105                         </t>\r
106                         <t>\r
107                                 JSON Schema format is organized into several separate definitions. The first \r
108                                 definition is the core schema specification. This definition is primary \r
109                                 concerned with describing a JSON structure and specifying valid elements\r
110                                 in the structure. The second definition is the Hyper Schema specification\r
111                                 which is intended define elements in a structure that can be interpreted as\r
112                                 hyperlinks.\r
113                                 Hyper Schema builds on JSON Schema to describe the hyperlink structure of \r
114                                 other JSON documents and elements of interaction. This allows user agents to be able to successfully navigate\r
115                                 JSON documents based on their schemas.\r
116                         </t>\r
117                         <t>\r
118                                 Cumulatively JSON Schema acts as a meta-document that can be used to define the required type and constraints on\r
119                                 property values, as well as define the meaning of the property values\r
120                                 for the purpose of describing a resource and determining hyperlinks\r
121                                 within the representation. \r
122                         </t>\r
123                         <figure>\r
124                                 <preamble>An example JSON Schema that describes products might look like:</preamble>\r
125                                 <artwork>\r
126 <![CDATA[       \r
127 {\r
128         "title": "Product",\r
129         "properties": {\r
130                 "id": {\r
131                         "type": "number",\r
132                         "description": "Product identifier",\r
133                         "required": true\r
134                 },\r
135                 "name": {\r
136                         "description": "Name of the product",\r
137                         "type": "string",\r
138                         "required": true\r
139                 },\r
140                 "price": {\r
141                         "required": true,\r
142                         "type": "number",\r
143                         "minimum": 0,\r
144                         "required": true\r
145                 },\r
146                 "tags": {\r
147                         "type": "array",\r
148                         "items": {\r
149                                 "type": "string"\r
150                         }\r
151                 }\r
152         },\r
153         "links": [{\r
154                 "rel": "full",\r
155                 "href": "{id}"\r
156         }, {\r
157                 "rel": "comments",\r
158                 "href": "comments/?id={id}"\r
159         }]\r
160 }\r
161 ]]>\r
162                                 </artwork>\r
163                                 <postamble>\r
164                                         This schema defines the properties of the instance JSON documents, \r
165                                         the required properties (id, name, and price), as well as an optional\r
166                                         property (tags). This also defines the link relations of the instance\r
167                                         JSON documents.\r
168                                 </postamble>\r
169                         </figure>\r
170                         \r
171                         <section title="Terminology">\r
172                                 <t>\r
173                                         For this specification, <spanx style="strong">schema</spanx> will be used to denote a JSON Schema \r
174                                         definition, and an <spanx style="strong">instance</spanx> refers to a JSON value that the schema \r
175                                         will be describing and validating.\r
176                                 </t>\r
177                         </section>\r
178                         \r
179                         <section title="Design Considerations">\r
180                                 <t>\r
181                                         The JSON Schema media type does not attempt to dictate the structure of JSON\r
182                                         representations that contain data, but rather provides a separate format\r
183                                         for flexibly communicating how a JSON representation should be\r
184                                         interpreted and validated, such that user agents can properly understand\r
185                                         acceptable structures and extrapolate hyperlink information\r
186                                         with the JSON document. It is acknowledged that JSON documents come\r
187                                         in a variety of structures, and JSON is unique in that the structure\r
188                                         of stored data structures often prescribes a non-ambiguous definite\r
189                                         JSON representation. Attempting to force a specific structure is generally\r
190                                         not viable, and therefore JSON Schema allows for a great flexibility\r
191                                         in the structure of the JSON data that it describes.\r
192                                 </t>\r
193                                 <t>\r
194                                         This specification is protocol agnostic.\r
195                                         The underlying protocol (such as HTTP) should sufficiently define the\r
196                                         semantics of the client-server interface, the retrieval of resource\r
197                                         representations linked to by JSON representations, and modification of \r
198                                         those resources. The goal of this\r
199                                         format is to sufficiently describe JSON structures such that one can\r
200                                         utilize existing information available in existing JSON\r
201                                         representations from a large variety of services that leverage a representational state transfer\r
202                                         architecture using existing protocols.\r
203                                 </t>\r
204                         </section>\r
205                 </section>\r
206                 \r
207                 <section title="Schema/Instance Association">\r
208                         <t>\r
209                                 JSON Schema instances are correlated to their schema by the "describedby"\r
210                                 relation, where the schema is defined to be the target of the relation.\r
211                                 Instance representations may be of the "application/json" media type or\r
212                                 any other subtype. Consequently, dictating how an instance\r
213                                 representation should specify the relation to the schema is beyond the normative scope\r
214                                 of this document (since this document specifically defines the JSON\r
215                                 Schema media type, and no other), but it is recommended that instances\r
216                                 specify their schema so that user agents can interpret the instance\r
217                                 representation and messages may retain the self-descriptive\r
218                                 characteristic, avoiding the need for out-of-band information about\r
219                                 instance data. Two approaches are recommended for declaring the\r
220                                 relation to the schema that describes the meaning of a JSON instance's (or collection \r
221                                 of instances) structure. A MIME type parameter named\r
222                                 "profile" or a relation of "describedby" (which could be defined by a Link header) may be used:\r
223                                 \r
224                                 <figure>\r
225                                         <artwork>\r
226 <![CDATA[       \r
227 Content-Type: application/my-media-type+json;\r
228               profile=http://json.com/my-hyper-schema\r
229 ]]>\r
230                                         </artwork>\r
231                                 </figure>\r
232                                 \r
233                                 or if the content is being transferred by a protocol (such as HTTP) that\r
234                                 provides headers, a Link header can be used:\r
235                                 \r
236                                 <figure>\r
237                                         <artwork>\r
238 <![CDATA[\r
239 Link: <http://json.com/my-hyper-schema>; rel="describedby"\r
240 ]]>\r
241                                         </artwork>\r
242                                 </figure>\r
243                                 \r
244                                 Instances MAY specify multiple schemas, to indicate all the schemas that \r
245                                 are applicable to the data, and the data SHOULD be valid by all the schemas. \r
246                                 The instance data MAY have multiple schemas \r
247                                 that it is defined by (the instance data SHOULD be valid for those schemas). \r
248                                 Or if the document is a collection of instances, the collection MAY contain \r
249                                 instances from different schemas. When collections contain heterogeneous \r
250                                 instances, the "pathStart" attribute MAY be specified in the \r
251                                 schema to disambiguate which schema should be applied for each item in the \r
252                                 collection. However, ultimately, the mechanism for referencing a schema is up to the\r
253                                 media type of the instance documents (if they choose to specify that schemas\r
254                                 can be referenced).\r
255                         </t>\r
256                         \r
257                         <section title="Self-Descriptive Schema">\r
258                                 <t>\r
259                                         JSON Schemas can themselves be described using JSON Schemas. \r
260                                         A self-describing JSON Schema for the core JSON Schema can\r
261                                         be found at <eref target="http://json-schema.org/schema">http://json-schema.org/schema</eref> for the latest version or \r
262                                         <eref target="http://json-schema.org/draft-03/schema">http://json-schema.org/draft-03/schema</eref> for the draft-03 version. The hyper schema \r
263                                         self-description can be found at <eref target="http://json-schema.org/hyper-schema">http://json-schema.org/hyper-schema</eref> \r
264                                         or <eref target="http://json-schema.org/draft-03/hyper-schema">http://json-schema.org/draft-03/hyper-schema</eref>. All schemas\r
265                                         used within a protocol with media type definitions\r
266                                         SHOULD include a MIME parameter that refers to the self-descriptive\r
267                                         hyper schema or another schema that extends this hyper schema:\r
268                                         \r
269                                         <figure>\r
270                                                 <artwork>\r
271 <![CDATA[       \r
272 Content-Type: application/json; \r
273               profile=http://json-schema.org/draft-03/hyper-schema\r
274 ]]>\r
275                                                 </artwork>\r
276                                         </figure>\r
277                                 </t>\r
278                         </section>\r
279                 </section>\r
280                 \r
281                 <section title="Core Schema Definition">\r
282                         <t>\r
283                                 A JSON Schema is a JSON Object that defines various attributes \r
284                                 (including usage and valid values) of a JSON value. JSON\r
285                                 Schema has recursive capabilities; there are a number of elements\r
286                                 in the structure that allow for nested JSON Schemas.\r
287                         </t>\r
288                         \r
289                         <figure>\r
290                                 <preamble>An example JSON Schema definition could look like:</preamble>\r
291                                 <artwork>\r
292 <![CDATA[\r
293 {\r
294         "description": "A person",\r
295         "type": "object",\r
296 \r
297         "properties": {\r
298                 "name": {\r
299                         "type": "string"\r
300                 },\r
301                 "age": {\r
302                         "type": "integer",\r
303                         "maximum": 125\r
304                 }\r
305         }\r
306 }\r
307 ]]>\r
308                                 </artwork>\r
309                         </figure>\r
310                         \r
311                         <t>\r
312                                 A JSON Schema object may have any of the following properties, called schema\r
313                                 attributes (all attributes are optional):\r
314                         </t>\r
315                         \r
316                         <section title="type">\r
317                                 <t>\r
318                                         This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. \r
319                                         This attribute can take one of two forms:\r
320 \r
321                                         <list style="hanging">\r
322                                                 <t hangText="Simple Types">\r
323                                                         A string indicating a primitive or simple type. The following are acceptable string values:\r
324 \r
325                                                         <list style="hanging">\r
326                                                                 <t hangText="string">Value MUST be a string.</t>\r
327                                                                 <t hangText="number">Value MUST be a number, floating point numbers are allowed. </t>\r
328                                                                 <t hangText="integer">Value MUST be an integer, no floating point numbers are allowed. This is a subset of the number type.</t>\r
329                                                                 <t hangText="boolean">Value MUST be a boolean. </t>\r
330                                                                 <t hangText="object">Value MUST be an object.</t>\r
331                                                                 <t hangText="array">Value MUST be an array.</t>\r
332                                                                 <t hangText="null">Value MUST be null. Note this is mainly for purpose of being able use union types to define nullability. If this type is not included in a union, null values are not allowed (the primitives listed above do not allow nulls on their own).</t>\r
333                                                                 <t hangText="any">Value MAY be of any type including null.</t>\r
334                                                         </list>\r
335                                                         \r
336                                                         If the property is not defined or is not in this list, then any type of value is acceptable. \r
337                                                         Other type values MAY be used for custom purposes, but minimal validators of the specification \r
338                                                         implementation can allow any instance value on unknown type values.\r
339                                                 </t>\r
340                                                 \r
341                                                 <t hangText="Union Types">\r
342                                                         An array of two or more simple type definitions. Each item in the array MUST be a simple type definition or a schema.\r
343                                                         The instance value is valid if it is of the same type as one of the simple type definitions, or valid by one of the schemas, in the array. \r
344                                                 </t>\r
345                                         </list>\r
346                                 </t>\r
347                                 \r
348                                 <figure>\r
349                                         <preamble>For example, a schema that defines if an instance can be a string or a number would be:</preamble>\r
350                                         <artwork>\r
351 <![CDATA[\r
352 {\r
353         "type": ["string", "number"]\r
354 }\r
355 ]]></artwork>\r
356                                 </figure>\r
357                         </section>\r
358                         \r
359                         <section title="properties" anchor="properties">\r
360                                 <t>This attribute is an object with property definitions that define the valid values of instance object property values. When the instance value is an object, the property values of the instance object MUST conform to the property definitions in this object. In this object, each property definition's value MUST be a schema, and the property's name MUST be the name of the instance property that it defines. The instance property value MUST be valid according to the schema from the property definition. Properties are considered unordered, the order of the instance properties MAY be in any order.</t>\r
361                         </section>\r
362                         \r
363                         <section title="patternProperties">\r
364                                 <t>This attribute is an object that defines the schema for a set of property names of an object instance. The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a schema. If the pattern matches the name of a property on the instance object, the value of the instance's property MUST be valid against the pattern name's schema value.</t>\r
365                         </section>\r
366                         \r
367                         <section title="additionalProperties" anchor="additionalProperties">\r
368                                 <t>This attribute defines a schema for all properties that are not explicitly defined in an object type definition. If specified, the value MUST be a schema or a boolean. If false is provided, no additional properties are allowed beyond the properties defined in the schema. The default value is an empty schema which allows any value for additional properties.</t>\r
369                         </section>\r
370                         \r
371                         <section title="items">\r
372                                 <t>This attribute defines the allowed items in an instance array, and MUST be a schema or an array of schemas. The default value is an empty schema which allows any value for items in the instance array.</t>\r
373                                 <t>When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema.</t>\r
374                                 <t>When this attribute value is an array of schemas and the instance value is an array, each position in the instance array MUST conform to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the <xref target="additionalItems">"additionalItems"</xref> attribute using the same rules as <xref target="additionalProperties">"additionalProperties"</xref> for objects.</t>\r
375                         </section>\r
376                         \r
377                         <section title="additionalItems" anchor="additionalItems">\r
378                                 <t>This provides a definition for additional items in an array instance when tuple definitions of the items is provided. This can be false to indicate additional items in the array are not allowed, or it can be a schema that defines the schema of the additional items.</t>\r
379                         </section>\r
380                         \r
381                         <section title="required">\r
382                                 <t>This attribute indicates if the instance must have a value, and not be undefined. This is false by default, making the instance optional.</t>\r
383                         </section>\r
384                         \r
385                         <section title="dependencies">\r
386                                 <t>This attribute is an object that defines the requirements of a property on an instance object. If an object instance has a property with the same name as a property in this attribute's object, then the instance must be valid against the attribute's property value (hereafter referred to as the "dependency value").</t>\r
387                                 <t>\r
388                                         The dependency value can take one of two forms:\r
389                                         \r
390                                         <list style="hanging">\r
391                                                 <t hangText="Simple Dependency">\r
392                                                         If the dependency value is a string, then the instance object MUST have a property with the same name as the dependency value.\r
393                                                         If the dependency value is an array of strings, then the instance object MUST have a property with the same name as each string in the dependency value's array.\r
394                                                 </t>\r
395                                                 <t hangText="Schema Dependency">\r
396                                                         If the dependency value is a schema, then the instance object MUST be valid against the schema.\r
397                                                 </t>\r
398                                         </list>\r
399                                 </t>\r
400                         </section>\r
401                         \r
402                         <section title="minimum">\r
403                                 <t>This attribute defines the minimum value of the instance property when the type of the instance value is a number.</t>\r
404                         </section>\r
405                         \r
406                         <section title="maximum">\r
407                                 <t>This attribute defines the maximum value of the instance property when the type of the instance value is a number.</t>\r
408                         </section>\r
409                         \r
410                         <section title="exclusiveMinimum">\r
411                                 <t>This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "minimum" attribute. This is false by default, meaning the instance value can be greater then or equal to the minimum value.</t>\r
412                         </section>\r
413                         \r
414                         <section title="exclusiveMaximum">\r
415                                 <t>This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "maximum" attribute. This is false by default, meaning the instance value can be less then or equal to the maximum value.</t>\r
416                         </section>\r
417                         \r
418                         <section title="minItems">\r
419                                 <t>This attribute defines the minimum number of values in an array when the array is the instance value.</t>\r
420                         </section>\r
421                         \r
422                         <section title="maxItems">\r
423                                 <t>This attribute defines the maximum number of values in an array when the array is the instance value.</t>\r
424                         </section>\r
425                         \r
426                         <section title="uniqueItems" anchor="uniqueItems">\r
427                                 <t>This attribute indicates that all items in an array instance MUST be unique (contains no two identical values).</t>\r
428                                 <t>\r
429                                         Two instance are consider equal if they are both of the same type and:\r
430                                         \r
431                                         <list>\r
432                                                 <t>are null; or</t>\r
433                                                 <t>are booleans/numbers/strings and have the same value; or</t>\r
434                                                 <t>are arrays, contains the same number of items, and each item in the array is equal to the corresponding item in the other array; or</t>\r
435                                                 <t>are objects, contains the same property names, and each property in the object is equal to the corresponding property in the other object.</t>\r
436                                         </list>\r
437                                 </t>\r
438                         </section>\r
439                         \r
440                         <section title="pattern">\r
441                                 <t>When the instance value is a string, this provides a regular expression that a string instance MUST match in order to be valid. Regular expressions SHOULD follow the regular expression specification from ECMA 262/Perl 5</t>\r
442                         </section>\r
443                         \r
444                         <section title="minLength">\r
445                                 <t>When the instance value is a string, this defines the minimum length of the string.</t>\r
446                         </section>\r
447                         \r
448                         <section title="maxLength">\r
449                                 <t>When the instance value is a string, this defines the maximum length of the string.</t>\r
450                         </section>\r
451                         \r
452                         <section title="enum">\r
453                                 <t>This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid. Comparison of enum values uses the same algorithm as defined in <xref target="uniqueItems">"uniqueItems"</xref>.</t>\r
454                         </section>\r
455                         \r
456                         <section title="default">\r
457                                 <t>This attribute defines the default value of the instance when the instance is undefined.</t>\r
458                         </section>\r
459                         \r
460                         <section title="title">\r
461                                 <t>This attribute is a string that provides a short description of the instance property.</t>\r
462                         </section>\r
463                         \r
464                         <section title="description">\r
465                                 <t>This attribute is a string that provides a full description of the of purpose the instance property.</t>\r
466                         </section>\r
467                         \r
468                         <section title="format">\r
469                                 <t>This property defines the type of data, content type, or microformat to be expected in the instance property values. A format attribute MAY be one of the values listed below, and if so, SHOULD adhere to the semantics describing for the format. A format SHOULD only be used to give meaning to primitive types (string, integer, number, or boolean). Validators MAY (but are not required to) validate that the instance values conform to a format.</t>\r
470                                 \r
471                                 <t>\r
472                                         The following formats are predefined:\r
473                                         \r
474                                         <list style="hanging">\r
475                                                 <t hangText="date-time">This SHOULD be a date in ISO 8601 format of YYYY-MM-DDThh:mm:ssZ in UTC time. This is the recommended form of date/timestamp.</t>\r
476                                                 <t hangText="date">This SHOULD be a date in the format of YYYY-MM-DD. It is recommended that you use the "date-time" format instead of "date" unless you need to transfer only the date part.</t>\r
477                                                 <t hangText="time">This SHOULD be a time in the format of hh:mm:ss. It is recommended that you use the "date-time" format instead of "time" unless you need to transfer only the time part.</t>\r
478                                                 <t hangText="utc-millisec">This SHOULD be the difference, measured in milliseconds, between the specified time and midnight, 00:00 of January 1, 1970 UTC. The value SHOULD be a number (integer or float).</t>\r
479                                                 <t hangText="regex">A regular expression, following the regular expression specification from ECMA 262/Perl 5.</t>\r
480                                                 <t hangText="color">This is a CSS color (like "#FF0000" or "red"), based on <xref target="W3C.CR-CSS21-20070719">CSS 2.1</xref>.</t>\r
481                                                 <t hangText="style">This is a CSS style definition (like "color: red; background-color:#FFF"), based on <xref target="W3C.CR-CSS21-20070719">CSS 2.1</xref>.</t>\r
482                                                 <t hangText="phone">This SHOULD be a phone number (format MAY follow E.123).</t>\r
483                                                 <t hangText="uri">This value SHOULD be a URI.</t>\r
484                                                 <t hangText="email">This SHOULD be an email address.</t>\r
485                                                 <t hangText="ip-address">This SHOULD be an ip version 4 address.</t>\r
486                                                 <t hangText="ipv6">This SHOULD be an ip version 6 address.</t>\r
487                                                 <t hangText="host-name">This SHOULD be a host-name.</t>\r
488                                         </list>\r
489                                 </t>\r
490                                 \r
491                                 <t>Additional custom formats MAY be created. These custom formats MAY be expressed as an URI, and this URI MAY reference a schema of that format.</t>\r
492                         </section>\r
493                         \r
494                         <section title="divisibleBy">\r
495                                 <t>This attribute defines what value the number instance must be divisible by with no remainder (the result of the division must be an integer.) The value of this attribute SHOULD NOT be 0.</t>\r
496                         </section>\r
497                         \r
498                         <section title="disallow">\r
499                                 <t>This attribute takes the same values as the "type" attribute, however if the instance matches the type or if this value is an array and the instance matches any type or schema in the array, then this instance is not valid.</t>\r
500                         </section>\r
501                         \r
502                         <section title="extends">\r
503                                 <t>The value of this property MUST be another schema which will provide a base schema which the current schema will inherit from. The inheritance rules are such that any instance that is valid according to the current schema MUST be valid according to the referenced schema. This MAY also be an array, in which case, the instance MUST be valid for all the schemas in the array. A schema that extends another schema MAY define additional attributes, constrain existing attributes, or add other constraints.</t>\r
504                                 <t>\r
505                                         Conceptually, the behavior of extends can be seen as validating an\r
506                                         instance against all constraints in the extending schema as well as\r
507                                         the extended schema(s). More optimized implementations that merge\r
508                                         schemas are possible, but are not required. Some examples of using "extends":\r
509                                         \r
510                                         <figure>\r
511                                                 <artwork>\r
512 <![CDATA[\r
513 {\r
514         "description": "An adult",\r
515         "properties": {\r
516                 "age": {\r
517                         "minimum": 21\r
518                 }\r
519         },\r
520         "extends": {"$ref": "person"}\r
521 }\r
522 ]]>\r
523                                                 </artwork>\r
524                                         </figure>\r
525                                         \r
526                                         <figure>\r
527                                                 <artwork>\r
528 <![CDATA[\r
529 {\r
530         "description": "Extended schema",\r
531         "properties": {\r
532                 "deprecated": {\r
533                         "type": "boolean"\r
534                 }\r
535         },\r
536         "extends": {"$ref": "http://json-schema.org/draft-03/schema"}\r
537 }\r
538 ]]>\r
539                                                 </artwork>\r
540                                         </figure>\r
541                                 </t>\r
542                         </section>\r
543                         \r
544                         <section title="id">\r
545                                 <t>\r
546                                         This attribute defines the current URI of this schema (this attribute is\r
547                                         effectively a "self" link). This URI MAY be relative or absolute. If\r
548                                         the URI is relative it is resolved against the current URI of the parent\r
549                                         schema it is contained in. If this schema is not contained in any\r
550                                         parent schema, the current URI of the parent schema is held to be the\r
551                                         URI under which this schema was addressed. If id is missing, the current URI of a schema is\r
552                                         defined to be that of the parent schema. The current URI of the schema\r
553                                         is also used to construct relative references such as for $ref.\r
554                                 </t>\r
555                         </section>\r
556                         \r
557                         <section title="$ref">\r
558                                 <t>\r
559                                         This attribute defines a URI of a schema that contains the full representation of this schema. \r
560                                         When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. \r
561                                         This URI MAY be relative or absolute, and relative URIs SHOULD be resolved against the URI of the current schema.\r
562                                 </t>\r
563                         </section>\r
564                         \r
565                         <section title="$schema">\r
566                                 <t>\r
567                                         This attribute defines a URI of a JSON Schema that is the schema of the current schema. \r
568                                         When this attribute is defined, a validator SHOULD use the schema referenced by the value's URI (if known and available) when resolving <xref target="hyper-schema">Hyper Schema</xref><xref target="links">links</xref>.\r
569                                 </t>\r
570                                 \r
571                                 <t>\r
572                                         A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. \r
573                                         Therefore, it is RECOMMENDED that all schema authors include this attribute in their schemas to prevent conflicts with future JSON Schema specification changes.\r
574                                 </t>\r
575                         </section>\r
576                 </section>\r
577                 \r
578                 <section title="Hyper Schema" anchor="hyper-schema">\r
579                         <t>\r
580                                 The following attributes are specified in addition to those\r
581                                 attributes that already provided by the core schema with the specific\r
582                                 purpose of informing user agents of relations between resources based\r
583                                 on JSON data. Just as with JSON\r
584                                 schema attributes, all the attributes in hyper schemas are optional.\r
585                                 Therefore, an empty object is a valid (non-informative) schema, and\r
586                                 essentially describes plain JSON (no constraints on the structures).\r
587                                 Addition of attributes provides additive information for user agents.\r
588                         </t>\r
589                         \r
590                         <section title="links" anchor="links">\r
591                                 <t>\r
592                                         The value of the links property MUST be an array, where each item \r
593                                         in the array is a link description object which describes the link\r
594                                         relations of the instances.\r
595                                 </t>\r
596                                 \r
597                                 <section title="Link Description Object">\r
598                                         <t>\r
599                                                 A link description object is used to describe link relations. In \r
600                                                 the context of a schema, it defines the link relations of the \r
601                                                 instances of the schema, and can be parameterized by the instance\r
602                                                 values. The link description format can be used on its own in\r
603                                                 regular (non-schema documents), and use of this format can\r
604                                                 be declared by referencing the normative link description\r
605                                                 schema as the the schema for the data structure that uses the \r
606                                                 links. The URI of the normative link description schema is: \r
607                                                 <eref target="http://json-schema.org/links">http://json-schema.org/links</eref> (latest version) or\r
608                                                 <eref target="http://json-schema.org/draft-03/links">http://json-schema.org/draft-03/links</eref> (draft-03 version).\r
609                                         </t>\r
610                                         \r
611                                         <section title="href">\r
612                                                 <t>\r
613                                                         The value of the "href" link description property\r
614                                                         indicates the target URI of the related resource. The value\r
615                                                         of the instance property SHOULD be resolved as a URI-Reference per <xref target="RFC3986">RFC 3986</xref>\r
616                                                         and MAY be a relative URI. The base URI to be used for relative resolution\r
617                                                         SHOULD be the URI used to retrieve the instance object (not the schema)\r
618                                                         when used within a schema. Also, when links are used within a schema, the URI \r
619                                                         SHOULD be parametrized by the property values of the instance \r
620                                                         object, if property values exist for the corresponding variables\r
621                                                         in the template (otherwise they MAY be provided from alternate sources, like user input).\r
622                                                 </t>\r
623                                                 \r
624                                                 <t>\r
625                                                         Instance property values SHOULD be substituted into the URIs where\r
626                                                         matching braces ('{', '}') are found surrounding zero or more characters,\r
627                                                         creating an expanded URI. Instance property value substitutions are resolved\r
628                                                         by using the text between the braces to denote the property name\r
629                                                         from the instance to get the value to substitute. \r
630                                                         \r
631                                                         <figure>\r
632                                                                 <preamble>For example, if an href value is defined:</preamble>\r
633                                                                 <artwork>\r
634 <![CDATA[\r
635 http://somesite.com/{id}\r
636 ]]>\r
637                                                                 </artwork>\r
638                                                                 <postamble>Then it would be resolved by replace the value of the "id" property value from the instance object.</postamble>\r
639                                                         </figure>\r
640                                                         \r
641                                                         <figure>\r
642                                                                 <preamble>If the value of the "id" property was "45", the expanded URI would be:</preamble>\r
643                                                                 <artwork>\r
644 <![CDATA[\r
645 http://somesite.com/45\r
646 ]]>\r
647                                                                 </artwork>\r
648                                                         </figure>\r
649                                                         \r
650                                                         If matching braces are found with the string "@" (no quotes) between the braces, then the \r
651                                                         actual instance value SHOULD be used to replace the braces, rather than a property value.\r
652                                                         This should only be used in situations where the instance is a scalar (string, \r
653                                                         boolean, or number), and not for objects or arrays.\r
654                                                 </t>\r
655                                         </section>\r
656                                         \r
657                                         <section title="rel">\r
658                                                 <t>\r
659                                                         The value of the "rel" property indicates the name of the \r
660                                                         relation to the target resource. The relation to the target SHOULD be interpreted as specifically from the instance object that the schema (or sub-schema) applies to, not just the top level resource that contains the object within its hierarchy. If a resource JSON representation contains a sub object with a property interpreted as a link, that sub-object holds the relation with the target. A relation to target from the top level resource MUST be indicated with the schema describing the top level JSON representation.\r
661                                                 </t>\r
662                                                 \r
663                                                 <t>\r
664                                                         Relationship definitions SHOULD NOT be media type dependent, and users are encouraged to utilize existing accepted relation definitions, including those in existing relation registries (see <xref target="RFC4287">RFC 4287</xref>). However, we define these relations here for clarity of normative interpretation within the context of JSON hyper schema defined relations:\r
665                                                         \r
666                                                         <list style="hanging">\r
667                                                                 <t hangText="self">\r
668                                                                         If the relation value is "self", when this property is encountered in\r
669                                                                         the instance object, the object represents a resource and the instance object is\r
670                                                                         treated as a full representation of the target resource identified by\r
671                                                                         the specified URI.\r
672                                                                 </t>\r
673                                                                 \r
674                                                                 <t hangText="full">\r
675                                                                         This indicates that the target of the link is the full representation for the instance object. The object that contains this link possibly may not be the full representation.\r
676                                                                 </t>\r
677                                                                 \r
678                                                                 <t hangText="describedby">\r
679                                                                         This indicates the target of the link is the schema for the instance object. This MAY be used to specifically denote the schemas of objects within a JSON object hierarchy, facilitating polymorphic type data structures.\r
680                                                                 </t>\r
681                                                                 \r
682                                                                 <t hangText="root">\r
683                                                                         This relation indicates that the target of the link\r
684                                                                         SHOULD be treated as the root or the body of the representation for the\r
685                                                                         purposes of user agent interaction or fragment resolution. All other\r
686                                                                         properties of the instance objects can be regarded as meta-data\r
687                                                                         descriptions for the data.\r
688                                                                 </t>\r
689                                                         </list>\r
690                                                 </t>\r
691                                                 \r
692                                                 <t>\r
693                                                         The following relations are applicable for schemas (the schema as the "from" resource in the relation):\r
694 \r
695                                                         <list style="hanging">\r
696                                                                 <t hangText="instances">This indicates the target resource that represents collection of instances of a schema.</t>\r
697                                                                 <t hangText="create">This indicates a target to use for creating new instances of a schema. This link definition SHOULD be a submission link with a non-safe method (like POST).</t>\r
698                                                         </list>\r
699                                                 </t>\r
700                                                 \r
701                                                 <t>\r
702                                                         <figure>\r
703                                                                 <preamble>For example, if a schema is defined:</preamble>\r
704                                                                 <artwork>\r
705 <![CDATA[\r
706 {\r
707         "links": [{\r
708                 "rel": "self",\r
709                 "href": "{id}"\r
710         }, {\r
711                 "rel": "up",\r
712                 "href": "{upId}"\r
713         }, {\r
714                 "rel": "children",\r
715                 "href": "?upId={id}"\r
716         }]\r
717 }\r
718 ]]>\r
719                                                                 </artwork>\r
720                                                         </figure>\r
721                                                         \r
722                                                         <figure>\r
723                                                                 <preamble>And if a collection of instance resource's JSON representation was retrieved:</preamble>\r
724                                                                 <artwork>\r
725 <![CDATA[\r
726 GET /Resource/\r
727 \r
728 [{\r
729         "id": "thing",\r
730         "upId": "parent"\r
731 }, {\r
732         "id": "thing2",\r
733         "upId": "parent"\r
734 }]\r
735 ]]>\r
736                                                                 </artwork>\r
737                                                         </figure>\r
738 \r
739                                                         This would indicate that for the first item in the collection, its own\r
740                                                         (self) URI would resolve to "/Resource/thing" and the first item's "up"\r
741                                                         relation SHOULD be resolved to the resource at "/Resource/parent".\r
742                                                         The "children" collection would be located at "/Resource/?upId=thing".\r
743                                                 </t>\r
744                                         </section>\r
745                                         \r
746                                         <section title="targetSchema">\r
747                                                 <t>This property value is a schema that defines the expected structure of the JSON representation of the target of the link.</t>\r
748                                         </section>\r
749                                         \r
750                                         <section title="Submission Link Properties">\r
751                                                 <t>\r
752                                                         The following properties also apply to link definition objects, and \r
753                                                         provide functionality analogous to HTML forms, in providing a \r
754                                                         means for submitting extra (often user supplied) information to send to a server.\r
755                                                 </t>\r
756                                                 \r
757                                                 <section title="method">\r
758                                                         <t>\r
759                                                                 This attribute defines which method can be used to access the target resource. \r
760                                                                 In an HTTP environment, this would be "GET" or "POST" (other HTTP methods \r
761                                                                 such as "PUT" and "DELETE" have semantics that are clearly implied by \r
762                                                                 accessed resources, and do not need to be defined here). \r
763                                                                 This defaults to "GET".\r
764                                                         </t>\r
765                                                 </section>\r
766                                                 \r
767                                                 <section title="enctype">\r
768                                                         <t>\r
769                                                                 If present, this property indicates a query media type format that the server\r
770                                                                 supports for querying or posting to the collection of instances at the target \r
771                                                                 resource. The query can be \r
772                                                                 suffixed to the target URI to query the collection with\r
773                                                                 property-based constraints on the resources that SHOULD be returned from\r
774                                                                 the server or used to post data to the resource (depending on the method).\r
775                                                                 \r
776                                                                 <figure>\r
777                                                                         <preamble>For example, with the following schema:</preamble>\r
778                                                                         <artwork>\r
779 <![CDATA[\r
780 {\r
781         "links": [{\r
782                 "enctype": "application/x-www-form-urlencoded",\r
783                 "method": "GET",\r
784                 "href": "/Product/",\r
785                 "properties": {\r
786                         "name": {\r
787                                 "description": "name of the product"\r
788                         }\r
789                 }\r
790         }]\r
791 }\r
792 ]]>\r
793                                                                         </artwork>\r
794                                                                         <postamble>This indicates that the client can query the server for instances that have a specific name.</postamble>\r
795                                                                 </figure>\r
796                                                                 \r
797                                                                 <figure>\r
798                                                                         <preamble>For example:</preamble>\r
799                                                                         <artwork>\r
800 <![CDATA[\r
801 /Product/?name=Slinky\r
802 ]]>\r
803                                                                         </artwork>\r
804                                                                 </figure>\r
805 \r
806                                                                 If no enctype or method is specified, only the single URI specified by \r
807                                                                 the href property is defined. If the method is POST, "application/json" is \r
808                                                                 the default media type.\r
809                                                         </t>\r
810                                                 </section>\r
811                                                 \r
812                                                 <section title="schema">\r
813                                                         <t>\r
814                                                                 This attribute contains a schema which defines the acceptable structure of the submitted\r
815                                                                 request (for a GET request, this schema would define the properties for the query string \r
816                                                                 and for a POST request, this would define the body).\r
817                                                         </t>\r
818                                                 </section>\r
819                                         </section>\r
820                                 </section>\r
821                         </section>\r
822                         \r
823                         <section title="fragmentResolution">\r
824                                 <t>\r
825                                         This property indicates the fragment resolution protocol to use for\r
826                                         resolving fragment identifiers in URIs within the instance\r
827                                         representations. This applies to the instance object URIs and all\r
828                                         children of the instance object's URIs. The default fragment resolution\r
829                                         protocol is "slash-delimited", which is defined below. Other fragment\r
830                                         resolution protocols MAY be used, but are not defined in this document.\r
831                                 </t>\r
832                                 \r
833                                 <t>\r
834                                         The fragment identifier is based on <xref target="RFC2396">RFC 2396, Sec 5</xref>, and defines the\r
835                                         mechanism for resolving references to entities within a document.\r
836                                 </t>\r
837                                 \r
838                                 <section title="slash-delimited fragment resolution">\r
839                                         <t>\r
840                                                 With the slash-delimited fragment resolution protocol, the fragment\r
841                                                 identifier is interpreted as a series of property reference tokens that start with and\r
842                                                 are delimited by the "/" character (\x2F). Each property reference token\r
843                                                 is a series of unreserved or escaped URI characters. Each property\r
844                                                 reference token SHOULD be interpreted, starting from the beginning of\r
845                                                 the fragment identifier, as a path reference in the target JSON\r
846                                                 structure. The final target value of the fragment can be determined by\r
847                                                 starting with the root of the JSON structure from the representation of\r
848                                                 the resource identified by the pre-fragment URI. If the target is a JSON\r
849                                                 object, then the new target is the value of the property with the name\r
850                                                 identified by the next property reference token in the fragment. If the\r
851                                                 target is a JSON array, then the target is determined by finding the\r
852                                                 item in array the array with the index defined by the next property\r
853                                                 reference token (which MUST be a number). The target is successively\r
854                                                 updated for each property reference token, until the entire fragment has\r
855                                                 been traversed. \r
856                                         </t>\r
857                                         \r
858                                         <t>\r
859                                                 Property names SHOULD be URI-encoded. In particular, any "/" in a \r
860                                                 property name MUST be encoded to avoid being interpreted as a property \r
861                                                 delimiter.\r
862                                         </t>\r
863                                         \r
864                                         <t>\r
865                                                 <figure>\r
866                                                         <preamble>For example, for the following JSON representation:</preamble>\r
867                                                         <artwork>\r
868 <![CDATA[\r
869 {\r
870         "foo": {\r
871                 "anArray": [{\r
872                         "prop": 44\r
873                 }],\r
874                 "another prop": {\r
875                         "baz": "A string"\r
876                 }\r
877         }\r
878 }\r
879 ]]>\r
880                                                         </artwork>\r
881                                                 </figure>\r
882                                                 \r
883                                                 <figure>\r
884                                                         <preamble>The following fragment identifiers would be resolved:</preamble>\r
885                                                         <artwork>\r
886 <![CDATA[\r
887 fragment identifier      resolution\r
888 -------------------      ----------\r
889 #                        self, the root of the resource itself\r
890 #/foo                    the object referred to by the foo property\r
891 #/foo/another%20prop     the object referred to by the "another prop"\r
892                          property of the object referred to by the \r
893                          "foo" property\r
894 #/foo/another%20prop/baz the string referred to by the value of "baz"\r
895                          property of the "another prop" property of \r
896                          the object referred to by the "foo" property\r
897 #/foo/anArray/0          the first object in the "anArray" array\r
898 ]]>\r
899                                                         </artwork>\r
900                                                 </figure>\r
901                                         </t>\r
902                                 </section>\r
903                                 \r
904                                 <section title="dot-delimited fragment resolution">\r
905                                         <t>\r
906                                                 The dot-delimited fragment resolution protocol is the same as \r
907                                                 slash-delimited fragment resolution protocol except that the "." character \r
908                                                 (\x2E) is used as the delimiter between property names (instead of "/") and \r
909                                                 the path does not need to start with a ".". For example, #.foo and #foo are a valid fragment\r
910                                                 identifiers for referencing the value of the foo propery.\r
911                                         </t>\r
912                                 </section>\r
913                         </section>\r
914                         \r
915                         <section title="readonly">\r
916                                 <t>This attribute indicates that the instance property SHOULD NOT be changed. Attempts by a user agent to modify the value of this property are expected to be rejected by a server.</t>\r
917                         </section>\r
918                         \r
919                         <section title="contentEncoding">\r
920                                 <t>If the instance property value is a string, this attribute defines that the string SHOULD be interpreted as binary data and decoded using the encoding named by this schema property. <xref target="RFC2045">RFC 2045, Sec 6.1</xref> lists the possible values for this property.</t>\r
921                         </section>\r
922                         \r
923                         <section title="pathStart">\r
924                                 <t>\r
925                                         This attribute is a URI that defines what the instance's URI MUST start with in order to validate. \r
926                                         The value of the "pathStart" attribute MUST be resolved as per <xref target="RFC3986">RFC 3986, Sec 5</xref>, \r
927                                         and is relative to the instance's URI.\r
928                                 </t>\r
929                                 \r
930                                 <t>\r
931                                         When multiple schemas have been referenced for an instance, the user agent \r
932                                         can determine if this schema is applicable for a particular instance by \r
933                                         determining if the URI of the instance begins with the the value of the "pathStart"\r
934                                         attribute. If the URI of the instance does not start with this URI, \r
935                                         or if another schema specifies a starting URI that is longer and also matches the \r
936                                         instance, this schema SHOULD NOT be applied to the instance. Any schema \r
937                                         that does not have a pathStart attribute SHOULD be considered applicable \r
938                                         to all the instances for which it is referenced.\r
939                                 </t>\r
940                         </section>\r
941                         \r
942                         <section title="mediaType">\r
943                                 <t>This attribute defines the media type of the instance representations that this schema is defining.</t>\r
944                         </section>\r
945                 </section>\r
946                 \r
947                 <section title="Security Considerations">\r
948                         <t>\r
949                                 This specification is a sub-type of the JSON format, and \r
950                                 consequently the security considerations are generally the same as <xref target="RFC4627">RFC 4627</xref>. \r
951                                 However, an additional issue is that when link relation of "self"\r
952                                 is used to denote a full representation of an object, the user agent \r
953                                 SHOULD NOT consider the representation to be the authoritative representation\r
954                                 of the resource denoted by the target URI if the target URI is not\r
955                                 equivalent to or a sub-path of the the URI used to request the resource \r
956                                 representation which contains the target URI with the "self" link.\r
957                                 \r
958                                 <figure>\r
959                                         <preamble>For example, if a hyper schema was defined:</preamble>\r
960                                         <artwork>\r
961 <![CDATA[\r
962 {\r
963         "links": [{\r
964                 "rel": "self",\r
965                 "href": "{id}"\r
966         }]\r
967 }\r
968 ]]>\r
969                                         </artwork>\r
970                                 </figure>\r
971                                 \r
972                                 <figure>\r
973                                         <preamble>And a resource was requested from somesite.com:</preamble>\r
974                                         <artwork>\r
975 <![CDATA[\r
976 GET /foo/\r
977 ]]>\r
978                                         </artwork>\r
979                                 </figure>\r
980 \r
981                                 <figure>\r
982                                         <preamble>With a response of:</preamble>\r
983                                         <artwork>\r
984 <![CDATA[\r
985 Content-Type: application/json; profile=/schema-for-this-data\r
986 \r
987 [{\r
988         "id": "bar",\r
989         "name": "This representation can be safely treated \\r
990                 as authoritative "\r
991 }, {\r
992         "id": "/baz",\r
993         "name": "This representation should not be treated as \\r
994                 authoritative the user agent should make request the resource\\r
995                 from '/baz' to ensure it has the authoritative representation"\r
996 }, {\r
997         "id": "http://othersite.com/something",\r
998         "name": "This representation\\r
999                 should also not be treated as authoritative and the target\\r
1000                 resource representation should be retrieved for the\\r
1001                 authoritative representation"\r
1002 }]\r
1003 ]]>\r
1004                                         </artwork>\r
1005                                 </figure>\r
1006                         </t>\r
1007                 </section>\r
1008                 \r
1009                 <section title="IANA Considerations">\r
1010                         <t>The proposed MIME media type for JSON Schema is "application/schema+json".</t>\r
1011                         <t>Type name: application</t>\r
1012                         <t>Subtype name: schema+json</t>\r
1013                         <t>Required parameters: profile</t>\r
1014                         <t>\r
1015                                 The value of the profile parameter SHOULD be a URI (relative or absolute) that \r
1016                                 refers to the schema used to define the structure of this structure (the \r
1017                                 meta-schema). Normally the value would be http://json-schema.org/draft-03/hyper-schema,\r
1018                                 but it is allowable to use other schemas that extend the hyper schema's meta-\r
1019                                 schema.\r
1020                         </t>\r
1021                         <t>Optional parameters: pretty</t>\r
1022                         <t>The value of the pretty parameter MAY be true or false to indicate if additional whitespace has been included to make the JSON representation easier to read.</t>\r
1023                         \r
1024                         <section title="Registry of Link Relations">\r
1025                                 <t>\r
1026                                         This registry is maintained by IANA per <xref target="RFC4287">RFC 4287</xref> and this specification adds\r
1027                                         four values: "full", "create", "instances", "root".  New\r
1028                                         assignments are subject to IESG Approval, as outlined in <xref target="RFC5226">RFC 5226</xref>.\r
1029                                         Requests should be made by email to IANA, which will then forward the\r
1030                                         request to the IESG, requesting approval.\r
1031                                 </t>\r
1032                         </section>\r
1033                 </section>\r
1034         </middle>\r
1035         \r
1036         <back>\r
1037                 <!-- References Section -->\r
1038                 <references title="Normative References">\r
1039                         &rfc2045;\r
1040                         &rfc2119;\r
1041                         &rfc2396;\r
1042                         &rfc3339;\r
1043                         &rfc3986;\r
1044                         &rfc4287;\r
1045                 </references>\r
1046                 <references title="Informative References">\r
1047                         &rfc2616;\r
1048                         &rfc4627;\r
1049                         &rfc5226;\r
1050                         &iddiscovery;\r
1051                         &uritemplate;\r
1052                         &linkheader;\r
1053                         &html401;\r
1054                         &css21;\r
1055                 </references>\r
1056 \r
1057                 <section title="Change Log">\r
1058                         <t>\r
1059                                 <list style="hanging">\r
1060                                         <t hangText="draft-03">\r
1061                                                 <list style="symbols">\r
1062                                                         <t>Added example and verbiage to "extends" attribute.</t>\r
1063                                                         <t>Defined slash-delimited to use a leading slash.</t>\r
1064                                                         <t>Made "root" a relation instead of an attribute.</t>\r
1065                                                         <t>Removed address values, and MIME media type from format to reduce confusion (mediaType already exists, so it can be used for MIME types).</t>\r
1066                                                         <t>Added more explanation of nullability.</t>\r
1067                                                         <t>Removed "alternate" attribute.</t>\r
1068                                                         <t>Upper cased many normative usages of must, may, and should.</t>\r
1069                                                         <t>Replaced the link submission "properties" attribute to "schema" attribute.</t>\r
1070                                                         <t>Replaced "optional" attribute with "required" attribute.</t>\r
1071                                                         <t>Replaced "maximumCanEqual" attribute with "exclusiveMaximum" attribute.</t>\r
1072                                                         <t>Replaced "minimumCanEqual" attribute with "exclusiveMinimum" attribute.</t>\r
1073                                                         <t>Replaced "requires" attribute with "dependencies" attribute.</t>\r
1074                                                         <t>Moved "contentEncoding" attribute to hyper schema.</t>\r
1075                                                         <t>Added "additionalItems" attribute.</t>\r
1076                                                         <t>Added "id" attribute.</t>\r
1077                                                         <t>Switched self-referencing variable substitution from "-this" to "@" to align with reserved characters in URI template.</t>\r
1078                                                         <t>Added "patternProperties" attribute.</t>\r
1079                                                         <t>Schema URIs are now namespace versioned.</t>\r
1080                                                         <t>Added "$ref" and "$schema" attributes.</t>\r
1081                                                 </list>\r
1082                                         </t>\r
1083                                         \r
1084                                         <t hangText="draft-02">\r
1085                                                 <list style="symbols">\r
1086                                                         <t>Replaced "maxDecimal" attribute with "divisibleBy" attribute.</t>\r
1087                                                         <t>Added slash-delimited fragment resolution protocol and made it the default.</t>\r
1088                                                         <t>Added language about using links outside of schemas by referencing its normative URI.</t>\r
1089                                                         <t>Added "uniqueItems" attribute.</t>\r
1090                                                         <t>Added "targetSchema" attribute to link description object.</t>\r
1091                                                 </list>\r
1092                                         </t>\r
1093                                         \r
1094                                         <t hangText="draft-01">\r
1095                                                 <list style="symbols">\r
1096                                                         <t>Fixed category and updates from template.</t>\r
1097                                                 </list>\r
1098                                         </t>\r
1099                                         \r
1100                                         <t hangText="draft-00">\r
1101                                                 <list style="symbols">\r
1102                                                         <t>Initial draft.</t>\r
1103                                                 </list>\r
1104                                         </t>\r
1105                                 </list>\r
1106                         </t>\r
1107                 </section>\r
1108                 \r
1109                 <section title="Open Issues">\r
1110                         <t>\r
1111                                 <list>\r
1112                                         <t>Should we give a preference to MIME headers over Link headers (or only use one)?</t>\r
1113                                         <t>Should "root" be a MIME parameter?</t>\r
1114                                         <t>Should "format" be renamed to "mediaType" or "contentType" to reflect the usage MIME media types that are allowed?</t>\r
1115                                         <t>How should dates be handled?</t>\r
1116                                 </list>\r
1117                         </t>\r
1118                 </section>\r
1119         </back>\r
1120 </rfc>\r