Skip to content

Commit c762b92

Browse files
noetixethanresnick
authored andcommitted
Always return "included" where "include" has been requested (json-api#1236)
* Always return "included" where "include" has been requested * Less repetition; clarify empty response * Fixed em-dash; wrapping * Feedback change
1 parent dfe5678 commit c762b92

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

_format/1.1/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,10 @@ client to customize which related resources should be returned.
943943
If an endpoint does not support the `include` parameter, it **MUST** respond
944944
with `400 Bad Request` to any requests that include it.
945945

946-
If an endpoint supports the `include` parameter and a client supplies it,
947-
the server **MUST NOT** include unrequested [resource objects] in the `included`
946+
If an endpoint supports the `include` parameter and a client supplies it:
947+
948+
- The server's response **MUST** be a [compound document] with an `included` key — even if that `included` key holds an empty array (because the requested relationships are empty).
949+
- The server **MUST NOT** include unrequested [resource objects] in the `included`
948950
section of the [compound document].
949951

950952
The value of the `include` parameter **MUST** be a comma-separated (U+002C

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