Open cmars opened 2 years ago
This could be linted with a type annotation indicating it's a singleton.
Proposal:
.data
under GET /resource
is an object, the resource is considered to be a singleton..data
is an object, not an array..data.id
is not specified. The type is its identity, because it is a singleton.@mrded I've spec'd this out to Optic in #195. They may have advice here on our WIP #192.
When updating singleton resources (there can be only one, like the Highlander),
.data.id
should be optional in the PATCH request body. This is a decision to depart from JSON API, which has this as an unconditional MUST.