Skip to content

Commit 18b3b85

Browse files
committed
More corrections to code vs. id; and http status fix'
1 parent f75f65d commit 18b3b85

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

examples/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ Content-Type: application/vnd.api+json
273273

274274
If the API docs specified:
275275

276-
> | Error Id | Title |
276+
> | Error Code | Title |
277277
> |------------|-----------------------------------------------------------------------------------|
278278
> | 11 | "Invalid Attribute" |
279279
> | 123 | "too short" |
@@ -282,7 +282,7 @@ If the API docs specified:
282282
> | 226 | "passwords do not match" |
283283
> | 227 | "password cannot be one of last five passwords" |
284284
285-
Multiple errors on `password` attribute, with error "id":
285+
Multiple errors on `password` attribute, with error "code":
286286

287287
```http
288288
HTTP/1.1 422 Unprocessable Entity
@@ -291,25 +291,25 @@ Content-Type: application/vnd.api+json
291291
{
292292
"errors": [
293293
{
294-
"id": "123",
294+
"code": "123",
295295
"source": { "pointer": "data/attributes/first-name" },
296296
"detail": "First name must contain at least three characters."
297297
},
298298
{
299-
"id": "225",
299+
"code": "225",
300300
"source": { "pointer": "data/attributes/password" },
301301
"detail": "Frobnicate is not a neologism."
302302
},
303303
{
304-
"id": "226",
304+
"code": "226",
305305
"source": { "pointer": "data/attributes/password" },
306306
"detail": "Password and password confirmation do not match."
307307
}
308308
]
309309
}
310310
```
311311

312-
Multiple errors on `first-name` attribute, with error "id", and "title":
312+
Multiple errors on `first-name` attribute, with error "code", and "title":
313313

314314
```http
315315
HTTP/1.1 422 Unprocessable Entity
@@ -318,13 +318,13 @@ Content-Type: application/vnd.api+json
318318
{
319319
"errors": [
320320
{
321-
"id": "123",
321+
"code": "123",
322322
"title": "too short",
323323
"source": { "pointer": "data/attributes/first-name" },
324324
"detail": "First name must contain at least three characters."
325325
},
326326
{
327-
"id": "124",
327+
"code": "124",
328328
"title": "emoji missing",
329329
"source": { "pointer": "data/attributes/first-name" },
330330
"detail": "First name must contain an emoji"
@@ -342,7 +342,7 @@ GET /posts/1,2,3,4
342342
```
343343

344344
```http
345-
HTTP/1.1 404 Not Found
345+
HTTP/1.1 400 Bad Request
346346
Content-Type: application/vnd.api+json
347347
348348

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