[MGNLREST-273] Allow requests for a restricted set of fields (sparse fieldsets) Created: 02/Sep/20  Updated: 02/Sep/20  Resolved: 02/Sep/20

Status: Closed
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Martin Drápela Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by MGNLGQL-30 DOC: Create GraphQL Feature page Closed
duplicate
duplicates MGNLREST-224 Specify fields to return Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

Citing: https://jsonapi.org/format/#fetching-sparse-fieldsets

A client MAY request that an endpoint return only specific fields in the response on a per-type basis by including a fields[TYPE] parameter.

The value of the fields parameter MUST be a comma-separated (U+002C COMMA, “,”) list that refers to the name(s) of the fields to be returned. An empty value indicates that no fields should be returned.

If a client requests a restricted set of fields for a given resource type, an endpoint MUST NOT include additional fields in resource objects of that type in its response.

If a client does not specify the set of fields for a given resource type, the server MAY send all fields, a subset of fields, or no fields for that resource type.

GET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1 Accept: application/vnd.api+json

Examples: https://jsonapi.org/examples/



 Comments   
Comment by Mikaël Geljić [ 02/Sep/20 ]

Magnolia does *not* specifically adhere to this JSON:API spec—which is not backed by any significant standard nor community process. Name of that alleged spec is also debatable as it may bring lots of confusion. We should also not refer to it in REST module documentation, if that's the case.

Meanwhile, the story here is a duplicate of MGNLREST-224, which is unlikely to have much traction, considering GraphQL solves this by design.

Generated at Mon Feb 12 06:58:17 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.