We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using sparse fieldsets, any related data that is included will be set to null.
null
For example, request to http://localhost:1479/api/v1/todoItems/375?include=owner returns:
http://localhost:1479/api/v1/todoItems/375?include=owner
{ "links": { "self": "http://localhost:1479/api/v1/todoItems/375" }, "data": { "type": "todoItems", "id": "375", "attributes": { "description": "Iusto harum voluptatem voluptatibus asperiores est iusto architecto eaque numquam.", "ordinal": 1, "guidProperty": "e0ca07d8-3db2-4060-a6d8-a910b0a1e672", "createdDate": "2019-11-08T06:59:38.612382", "achievedDate": null, "updatedDate": null, "calculatedValue": "calculated", "offsetDate": null }, "relationships": { "owner": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/owner", "related": "http://localhost:1479/api/v1/todoItems/375/owner" }, "data": { "type": "people", "id": "129" } }, "assignee": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/assignee", "related": "http://localhost:1479/api/v1/todoItems/375/assignee" } }, "oneToOnePerson": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/oneToOnePerson", "related": "http://localhost:1479/api/v1/todoItems/375/oneToOnePerson" } }, "stakeHolders": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/stakeHolders", "related": "http://localhost:1479/api/v1/todoItems/375/stakeHolders" } }, "collection": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/collection", "related": "http://localhost:1479/api/v1/todoItems/375/collection" } }, "dependentOnTodo": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/dependentOnTodo", "related": "http://localhost:1479/api/v1/todoItems/375/dependentOnTodo" } }, "parentTodo": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/parentTodo", "related": "http://localhost:1479/api/v1/todoItems/375/parentTodo" } }, "childrenTodos": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/childrenTodos", "related": "http://localhost:1479/api/v1/todoItems/375/childrenTodos" } } }, "links": { "self": "http://localhost:1479/api/v1/todoItems/375" } }, "included": [ { "type": "people", "id": "129", "attributes": { "firstName": "Tiffany", "lastName": "Kub", "age": 97 }, "relationships": { "todoItems": { "links": { "self": "http://localhost:1479/api/v1/people/129/relationships/todoItems", "related": "http://localhost:1479/api/v1/people/129/todoItems" } }, "assignedTodoItems": { "links": { "self": "http://localhost:1479/api/v1/people/129/relationships/assignedTodoItems", "related": "http://localhost:1479/api/v1/people/129/assignedTodoItems" } }, "todoCollections": { "links": { "self": "http://localhost:1479/api/v1/people/129/relationships/todoCollections", "related": "http://localhost:1479/api/v1/people/129/todoCollections" } }, "role": { "links": { "self": "http://localhost:1479/api/v1/people/129/relationships/role", "related": "http://localhost:1479/api/v1/people/129/role" } }, "oneToOneTodoItem": { "links": { "self": "http://localhost:1479/api/v1/people/129/relationships/oneToOneTodoItem", "related": "http://localhost:1479/api/v1/people/129/oneToOneTodoItem" } }, "stakeHolderTodoItem": { "links": { "self": "http://localhost:1479/api/v1/people/129/relationships/stakeHolderTodoItem", "related": "http://localhost:1479/api/v1/people/129/stakeHolderTodoItem" } }, "unIncludeableItem": { "links": { "self": "http://localhost:1479/api/v1/people/129/relationships/unIncludeableItem", "related": "http://localhost:1479/api/v1/people/129/unIncludeableItem" } }, "passport": { "links": { "self": "http://localhost:1479/api/v1/people/129/relationships/passport", "related": "http://localhost:1479/api/v1/people/129/passport" } } }, "links": { "self": "http://localhost:1479/api/v1/people/129" } } ] }
But request to http://localhost:1479/api/v1/todoItems/375?include=owner&fields=description returns:
http://localhost:1479/api/v1/todoItems/375?include=owner&fields=description
{ "links": { "self": "http://localhost:1479/api/v1/todoItems/375" }, "data": { "type": "todoItems", "id": "375", "attributes": { "description": "Iusto harum voluptatem voluptatibus asperiores est iusto architecto eaque numquam." }, "relationships": { "owner": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/owner", "related": "http://localhost:1479/api/v1/todoItems/375/owner" }, "data": null }, "assignee": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/assignee", "related": "http://localhost:1479/api/v1/todoItems/375/assignee" } }, "oneToOnePerson": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/oneToOnePerson", "related": "http://localhost:1479/api/v1/todoItems/375/oneToOnePerson" } }, "stakeHolders": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/stakeHolders", "related": "http://localhost:1479/api/v1/todoItems/375/stakeHolders" } }, "collection": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/collection", "related": "http://localhost:1479/api/v1/todoItems/375/collection" } }, "dependentOnTodo": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/dependentOnTodo", "related": "http://localhost:1479/api/v1/todoItems/375/dependentOnTodo" } }, "parentTodo": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/parentTodo", "related": "http://localhost:1479/api/v1/todoItems/375/parentTodo" } }, "childrenTodos": { "links": { "self": "http://localhost:1479/api/v1/todoItems/375/relationships/childrenTodos", "related": "http://localhost:1479/api/v1/todoItems/375/childrenTodos" } } }, "links": { "self": "http://localhost:1479/api/v1/todoItems/375" } } }
Note how data.relationships.owner.data has been set to null in the second response.
data.relationships.owner.data
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
When using sparse fieldsets, any related data that is included will be set to
null
.For example, request to
http://localhost:1479/api/v1/todoItems/375?include=owner
returns:But request to
http://localhost:1479/api/v1/todoItems/375?include=owner&fields=description
returns:Note how
data.relationships.owner.data
has been set tonull
in the second response.The text was updated successfully, but these errors were encountered: