|
150 | 150 | },
|
151 | 151 | "additionalProperties": false
|
152 | 152 | },
|
153 |
| - |
154 |
| - "links": { |
| 153 | + |
| 154 | + "relationshipLinks": { |
155 | 155 | "description": "A resource object **MAY** contain references to other resource objects (\"relationships\"). Relationships may be to-one or to-many. Relationships can be specified by including a member in a resource's links object.",
|
156 | 156 | "type": "object",
|
157 | 157 | "properties": {
|
158 | 158 | "self": {
|
159 | 159 | "description": "A `self` member, whose value is a URL for the relationship itself (a \"relationship URL\"). This URL allows the client to directly manipulate the relationship. For example, it would allow a client to remove an `author` from an `article` without deleting the people resource itself.",
|
160 |
| - "type": "string", |
161 |
| - "format": "uri" |
| 160 | + "$ref": "#/definitions/link" |
162 | 161 | },
|
163 | 162 | "related": {
|
164 | 163 | "$ref": "#/definitions/link"
|
165 | 164 | }
|
166 | 165 | },
|
167 | 166 | "additionalProperties": true
|
168 | 167 | },
|
| 168 | + "links": { |
| 169 | + "type": "object", |
| 170 | + "additionalProperties": { |
| 171 | + "$ref": "#/definitions/link" |
| 172 | + } |
| 173 | + }, |
169 | 174 | "link": {
|
170 | 175 | "description": "A link **MUST** be represented as either: a string containing the link's URL or a link object.",
|
171 | 176 | "oneOf": [
|
172 | 177 | {
|
173 | 178 | "description": "A string containing the link's URL.",
|
174 | 179 | "type": "string",
|
175 |
| - "format": "uri" |
| 180 | + "format": "uri-reference" |
176 | 181 | },
|
177 | 182 | {
|
178 | 183 | "type": "object",
|
|
183 | 188 | "href": {
|
184 | 189 | "description": "A string containing the link's URL.",
|
185 | 190 | "type": "string",
|
186 |
| - "format": "uri" |
| 191 | + "format": "uri-reference" |
187 | 192 | },
|
188 | 193 | "meta": {
|
189 | 194 | "$ref": "#/definitions/meta"
|
|
197 | 202 | "description": "Members of the attributes object (\"attributes\") represent information about the resource object in which it's defined.",
|
198 | 203 | "type": "object",
|
199 | 204 | "patternProperties": {
|
200 |
| - "^(?!relationships$|links$)\\w[-\\w_]*$": { |
| 205 | + "^(?!relationships$|links$|id$|type$)\\w[-\\w_]*$": { |
201 | 206 | "description": "Attributes may contain any valid JSON value."
|
202 | 207 | }
|
203 | 208 | },
|
|
208 | 213 | "description": "Members of the relationships object (\"relationships\") represent references from the resource object in which it's defined to other resource objects.",
|
209 | 214 | "type": "object",
|
210 | 215 | "patternProperties": {
|
211 |
| - "^\\w[-\\w_]*$": { |
| 216 | + "^(?!id$|type$)\\w[-\\w_]*$": { |
212 | 217 | "properties": {
|
213 | 218 | "links": {
|
214 |
| - "$ref": "#/definitions/links" |
| 219 | + "$ref": "#/definitions/relationshipLinks" |
215 | 220 | },
|
216 | 221 | "data": {
|
217 | 222 | "description": "Member, whose value represents \"resource linkage\".",
|
|
287 | 292 | "first": {
|
288 | 293 | "description": "The first page of data",
|
289 | 294 | "oneOf": [
|
290 |
| - { "type": "string", "format": "uri" }, |
| 295 | + { "type": "string", "format": "uri-reference" }, |
291 | 296 | { "type": "null" }
|
292 | 297 | ]
|
293 | 298 | },
|
294 | 299 | "last": {
|
295 | 300 | "description": "The last page of data",
|
296 | 301 | "oneOf": [
|
297 |
| - { "type": "string", "format": "uri" }, |
| 302 | + { "type": "string", "format": "uri-reference" }, |
298 | 303 | { "type": "null" }
|
299 | 304 | ]
|
300 | 305 | },
|
301 | 306 | "prev": {
|
302 | 307 | "description": "The previous page of data",
|
303 | 308 | "oneOf": [
|
304 |
| - { "type": "string", "format": "uri" }, |
| 309 | + { "type": "string", "format": "uri-reference" }, |
305 | 310 | { "type": "null" }
|
306 | 311 | ]
|
307 | 312 | },
|
308 | 313 | "next": {
|
309 | 314 | "description": "The next page of data",
|
310 | 315 | "oneOf": [
|
311 |
| - { "type": "string", "format": "uri" }, |
| 316 | + { "type": "string", "format": "uri-reference" }, |
312 | 317 | { "type": "null" }
|
313 | 318 | ]
|
314 | 319 | }
|
|
0 commit comments