Skip to content

Commit 2da44ee

Browse files
authored
fix(schema): Apply schema fixes from upstream (#81)
* json-api/json-api#1160 * json-api/json-api#1169 * json-api/json-api#1171
1 parent fdc11aa commit 2da44ee

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

lib/schema.json

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,29 +150,34 @@
150150
},
151151
"additionalProperties": false
152152
},
153-
154-
"links": {
153+
154+
"relationshipLinks": {
155155
"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.",
156156
"type": "object",
157157
"properties": {
158158
"self": {
159159
"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"
162161
},
163162
"related": {
164163
"$ref": "#/definitions/link"
165164
}
166165
},
167166
"additionalProperties": true
168167
},
168+
"links": {
169+
"type": "object",
170+
"additionalProperties": {
171+
"$ref": "#/definitions/link"
172+
}
173+
},
169174
"link": {
170175
"description": "A link **MUST** be represented as either: a string containing the link's URL or a link object.",
171176
"oneOf": [
172177
{
173178
"description": "A string containing the link's URL.",
174179
"type": "string",
175-
"format": "uri"
180+
"format": "uri-reference"
176181
},
177182
{
178183
"type": "object",
@@ -183,7 +188,7 @@
183188
"href": {
184189
"description": "A string containing the link's URL.",
185190
"type": "string",
186-
"format": "uri"
191+
"format": "uri-reference"
187192
},
188193
"meta": {
189194
"$ref": "#/definitions/meta"
@@ -197,7 +202,7 @@
197202
"description": "Members of the attributes object (\"attributes\") represent information about the resource object in which it's defined.",
198203
"type": "object",
199204
"patternProperties": {
200-
"^(?!relationships$|links$)\\w[-\\w_]*$": {
205+
"^(?!relationships$|links$|id$|type$)\\w[-\\w_]*$": {
201206
"description": "Attributes may contain any valid JSON value."
202207
}
203208
},
@@ -208,10 +213,10 @@
208213
"description": "Members of the relationships object (\"relationships\") represent references from the resource object in which it's defined to other resource objects.",
209214
"type": "object",
210215
"patternProperties": {
211-
"^\\w[-\\w_]*$": {
216+
"^(?!id$|type$)\\w[-\\w_]*$": {
212217
"properties": {
213218
"links": {
214-
"$ref": "#/definitions/links"
219+
"$ref": "#/definitions/relationshipLinks"
215220
},
216221
"data": {
217222
"description": "Member, whose value represents \"resource linkage\".",
@@ -287,28 +292,28 @@
287292
"first": {
288293
"description": "The first page of data",
289294
"oneOf": [
290-
{ "type": "string", "format": "uri" },
295+
{ "type": "string", "format": "uri-reference" },
291296
{ "type": "null" }
292297
]
293298
},
294299
"last": {
295300
"description": "The last page of data",
296301
"oneOf": [
297-
{ "type": "string", "format": "uri" },
302+
{ "type": "string", "format": "uri-reference" },
298303
{ "type": "null" }
299304
]
300305
},
301306
"prev": {
302307
"description": "The previous page of data",
303308
"oneOf": [
304-
{ "type": "string", "format": "uri" },
309+
{ "type": "string", "format": "uri-reference" },
305310
{ "type": "null" }
306311
]
307312
},
308313
"next": {
309314
"description": "The next page of data",
310315
"oneOf": [
311-
{ "type": "string", "format": "uri" },
316+
{ "type": "string", "format": "uri-reference" },
312317
{ "type": "null" }
313318
]
314319
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy