Skip to content

Commit d0db57a

Browse files
authored
Merge pull request #1036 from beauby/404-create-missing-related
Add response status for POST with inexistent related resource.
2 parents 2ee03cf + 8cd108e commit d0db57a

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

_format/1.0/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,11 @@ had returned it back in a `201` response.
12711271
A server **MAY** return `403 Forbidden` in response to an unsupported request
12721272
to create a resource.
12731273

1274+
##### <a href="#crud-creating-responses-404" id="crud-creating-responses-404" class="headerlink"></a> 404 Not Found
1275+
1276+
A server **MUST** return `404 Not Found` when processing a request that
1277+
references a related resource that does not exist.
1278+
12741279
##### <a href="#crud-creating-responses-409" id="crud-creating-responses-409" class="headerlink"></a> 409 Conflict
12751280

12761281
A server **MUST** return `409 Conflict` when processing a `POST` request to

_format/1.0/normative-statements.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ layout: null
181181
{ "id": "create-responses-202", "type": "normative-statements" },
182182
{ "id": "create-responses-204", "type": "normative-statements" },
183183
{ "id": "create-responses-403", "type": "normative-statements" },
184+
{ "id": "create-responses-404-related", "type": "normative-statements" },
184185
{ "id": "create-responses-409-exists", "type": "normative-statements" },
185186
{ "id": "create-responses-409-bad-type", "type": "normative-statements" },
186187
{ "id": "create-responses-409-error-details", "type": "normative-statements" },
@@ -1770,6 +1771,19 @@ layout: null
17701771
}
17711772
}
17721773
},
1774+
{
1775+
"id": "create-responses-404-related",
1776+
"type": "normative-statements",
1777+
"attributes": {
1778+
"level": "MAY",
1779+
"description": "A server **MUST** return `404 Not Found` when processing a request that references a related resource that does not exist."
1780+
},
1781+
"relationships": {
1782+
"section": {
1783+
"data": { "id": "creating-updating-deleting", "type": "sections" }
1784+
}
1785+
}
1786+
},
17731787
{
17741788
"id": "create-responses-409-exists",
17751789
"type": "normative-statements",

_format/1.1/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,11 @@ had returned it back in a `201` response.
12921292
A server **MAY** return `403 Forbidden` in response to an unsupported request
12931293
to create a resource.
12941294

1295+
##### <a href="#crud-creating-responses-404" id="crud-creating-responses-404" class="headerlink"></a> 404 Not Found
1296+
1297+
A server **MUST** return `404 Not Found` when processing a request that
1298+
references a related resource that does not exist.
1299+
12951300
##### <a href="#crud-creating-responses-409" id="crud-creating-responses-409" class="headerlink"></a> 409 Conflict
12961301

12971302
A server **MUST** return `409 Conflict` when processing a `POST` request to

_format/1.1/normative-statements.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ layout: null
185185
{ "id": "create-responses-202", "type": "normative-statements" },
186186
{ "id": "create-responses-204", "type": "normative-statements" },
187187
{ "id": "create-responses-403", "type": "normative-statements" },
188+
{ "id": "create-responses-404-related", "type": "normative-statements" },
188189
{ "id": "create-responses-409-exists", "type": "normative-statements" },
189190
{ "id": "create-responses-409-bad-type", "type": "normative-statements" },
190191
{ "id": "create-responses-409-error-details", "type": "normative-statements" },
@@ -1826,6 +1827,19 @@ layout: null
18261827
}
18271828
}
18281829
},
1830+
{
1831+
"id": "create-responses-404-related",
1832+
"type": "normative-statements",
1833+
"attributes": {
1834+
"level": "MAY",
1835+
"description": "A server **MUST** return `404 Not Found` when processing a request that references a related resource that does not exist."
1836+
},
1837+
"relationships": {
1838+
"section": {
1839+
"data": { "id": "creating-updating-deleting", "type": "sections" }
1840+
}
1841+
}
1842+
},
18291843
{
18301844
"id": "create-responses-409-exists",
18311845
"type": "normative-statements",

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