IPA-115: Envelope Object
Some clients might not be able to access the HTTP response headers and/or status code. In that case, clients can request that the response include an "envelope," which is simply an extra layer of information in the JSON document and contains any relevant details that would normally be in the response headers.
State
Adopt
Guidance
- Resources may support a boolean
envelope
query parameter envelope
must default to false- If
envelope
is set totrue
for individual resources- The response must include the field
status
as the HTTP status code - The response must include the field
content
as the requested resource
- The response must include the field
- If
envelope
is set totrue
for Paginated resources the existing response must include the fieldstatus
as the HTTP status code
Generated API Clients
- Generated clients must not support envelope
- Conditionally changing the shape of a response is not supported by code generation tools