|
127 | 127 |
|
128 | 128 | <section title="Overview">
|
129 | 129 | <t>
|
130 |
| - This document proposes a new media type "application/schema+json" to identify a JSON |
131 |
| - Schema for describing JSON data. |
132 |
| - It also proposes a further optional media type, "application/schema-instance+json", |
133 |
| - to provide additional integration features. |
| 130 | + This document specifies the media type "application/schema+json" which |
| 131 | + can describe a set of JSON documents, classify documents as instances of this set, |
| 132 | + and to generate annotations about a given instance. |
| 133 | + It also specifies "application/schema-instance+json", |
| 134 | + to describe JSON documents known to be instances of a particular schema. |
134 | 135 | JSON Schemas are themselves JSON documents.
|
135 |
| - This, and related specifications, define keywords allowing authors to describe JSON |
136 |
| - data in several ways. |
137 | 136 | </t>
|
138 | 137 | <t>
|
139 |
| - JSON Schema uses keywords to assert constraints on JSON instances or annotate those |
140 |
| - instances with additional information. Additional keywords are used to apply |
141 |
| - assertions and annotations to more complex JSON data structures, or based on |
142 |
| - some sort of condition. |
| 138 | + A JSON Schema document consists of a set of keywords, |
| 139 | + typically encoded as properties in a JSON object. |
| 140 | + The name of the keyword is used as the property name, |
| 141 | + and any arguments to the keyword are provided as the value. |
| 142 | + </t> |
| 143 | + <t> |
| 144 | + Each keyword provides an assertion and/or annotations about the instance. |
| 145 | + Assertions add constraints that instances must conform to. |
| 146 | + Given a schema and an instance, the schema "accepts" an instance whenever all the assertions are met, |
| 147 | + and the schema "rejects" when any of the assertions fail. |
| 148 | + Schemas may also be used to build a set of JSON documents: |
| 149 | + The "valid set" of a schema consists of all instances that the schema accepts, |
| 150 | + and the "invalid set" of a schema consists of all instances that the schema rejects. |
| 151 | + In a schema without any assertion keywords, the set of all instances is the set of all JSON documents. |
| 152 | + </t> |
| 153 | + <t> |
| 154 | + Schemas may also provide "annotations" to instances: |
| 155 | + metadata that describes the instance. |
| 156 | + For example, you can document the meaning of a property, |
| 157 | + suggest a default value for new instances, |
| 158 | + generate a list of hyperlinks from the instance, |
| 159 | + or declare relationships between data. |
143 | 160 | </t>
|
144 | 161 | <t>
|
145 | 162 | To facilitate re-use, keywords can be organized into vocabularies. A vocabulary
|
|
0 commit comments