Add partial response collection type#10
Conversation
versions/1.0/index.md
Outdated
|
|
||
| ## <a href="#document-components-collection" id="document-components-collection" class="headerlink"></a> Partial Collection (Optional) | ||
| Server **MAY** support an ability to return only specific fields requested by client. | ||
| A `PartialCollection` is a type of [node](#document-components-node) used to represent a specific resource fields based on query string parameter |
There was a problem hiding this comment.
As per our discussion, i think this should become its own section called Sparse Fields or something along those lines, instead of creating a PartialCollection. This will allow clients to filter resources by attributes while still maintaining what resource they are filtering.
ex.
{
"@id": "/users?fields=/given_name",
"@type": "Collection",
"items": [
{
"@id": "/users/1",
"@type": "User",
"given_name": "Hubert"
},
{
"@id": "/users/2",
"@type": "User",
"given_name": "John"
}
...
],
"total_items": 20
}
There was a problem hiding this comment.
The way jsonapi does this is similar: https://jsonapi.org/format/#fetching-includes, though a difference here is that includes is additional data that would be fetched if the param was present. Just another example to look at.
There was a problem hiding this comment.
Looks like they've added sparse fieldsets to jsonapi now too: https://jsonapi.org/format/#fetching-sparse-fieldsets
thehelix112
left a comment
There was a problem hiding this comment.
Looks good to me, esp with link to rfc for json pointers as not all folks will know what that is.
versions/1.0/index.md
Outdated
|
|
||
| ## <a href="#document-components-collection" id="document-components-collection" class="headerlink"></a> Sparse Field Sets (Optional) | ||
| Server **MAY** support an ability to return only specific fields requested by client. | ||
| * `fields`: query string parameter comma delimited list of fields. May include nested json fields using json pointers |
There was a problem hiding this comment.
Suggest "json pointers" is a link to https://tools.ietf.org/html/rfc6901
No description provided.