|
121 | 121 | <t>
|
122 | 122 | This document describes how JSON Schema can be used to define hyperlinks on instance
|
123 | 123 | data.
|
124 |
| - It also defines how to provide additional information required to interpret JSON |
125 |
| - data as rich multimedia documents. |
126 | 124 | </t>
|
127 | 125 | <t>
|
128 | 126 | As with all JSON Schema keywords, all the keywords described in the "Schema
|
|
131 | 129 | </t>
|
132 | 130 | <figure>
|
133 | 131 | <preamble>
|
134 |
| - Here is an example JSON Schema defining hyperlinks, and providing a multimedia |
135 |
| - interpretation for the "imgData" property: |
| 132 | + Here is an example JSON Schema defining hyperlinks: |
136 | 133 | </preamble>
|
137 | 134 | <artwork>
|
138 | 135 | <![CDATA[
|
|
151 | 148 | },
|
152 | 149 | "authorId": {
|
153 | 150 | "type": "integer"
|
154 |
| - }, |
155 |
| - "imgData": { |
156 |
| - "title": "Article Illustration (thumbnail)", |
157 |
| - "type": "string", |
158 |
| - "media": { |
159 |
| - "binaryEncoding": "base64", |
160 |
| - "type": "image/png" |
161 |
| - } |
162 | 151 | }
|
163 | 152 | },
|
164 | 153 | "required" : ["id", "title", "authorId"],
|
|
176 | 165 | ]]>
|
177 | 166 | </artwork>
|
178 | 167 | <postamble>
|
179 |
| - This example schema defines the properties of the instance. For the "imgData" |
180 |
| - property, it specifies that that it should be base64-decoded and the resulting |
181 |
| - binary data treated as a PNG image. |
182 |
| - It also defines link relations for the instance, with URIs incorporating values |
183 |
| - from the instance. |
| 168 | + This example schema defines the properties of the instance as well as link |
| 169 | + relations for the instance, with URIs incorporating values from the instance. |
184 | 170 | <cref>
|
185 | 171 | "id" probably should not normally be a required keyword, since new instances
|
186 | 172 | will have an unknown "id" property until is it assigned by the server.
|
|
190 | 176 | </postamble>
|
191 | 177 | </figure>
|
192 | 178 |
|
193 |
| - <figure> |
194 |
| - <preamble> |
195 |
| - An example of a JSON instance described by the above schema might be: |
196 |
| - </preamble> |
197 |
| - <artwork> |
198 |
| -<![CDATA[ |
199 |
| -{ |
200 |
| - "id": 15, |
201 |
| - "title": "Example data", |
202 |
| - "authorId": 105, |
203 |
| - "imgData": "iVBORw...kJggg==" |
204 |
| -} |
205 |
| -]]> |
206 |
| - </artwork> |
207 |
| - <postamble> |
208 |
| - The base-64 data has been abbreviated for readability. |
209 |
| - </postamble> |
210 |
| - </figure> |
211 |
| - |
212 | 179 | <section title="Interaction with validation">
|
213 | 180 | <t>
|
214 | 181 | Hyper-schema keywords can be applied when the instance is valid against
|
|
0 commit comments