Skip to content
New issue

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

Exclusion of 'id' and 'type' properties upon request #209

Closed
merkys opened this issue Nov 25, 2019 · 2 comments · Fixed by #210
Closed

Exclusion of 'id' and 'type' properties upon request #209

merkys opened this issue Nov 25, 2019 · 2 comments · Fixed by #210
Labels
status/has-concrete-suggestion This issue has one or more concrete suggestions spelled out that can be brought up for consensus. type/bug A bug or problem in the specification. Needs to be addressed quickly.

Comments

@merkys
Copy link
Member

merkys commented Nov 25, 2019

The specification allows exclusion of id and type properties upon request. Although having no "special" properties sounds nice, JSON response without id and type is invalid according to JSON API specification. Moreover, I cannot think of a use case when the output without idand type would be beneficial. Shall we define id and type attributes as mandatory regardless the value of response_fields?

@merkys merkys added type/bug A bug or problem in the specification. Needs to be addressed quickly. status/has-concrete-suggestion This issue has one or more concrete suggestions spelled out that can be brought up for consensus. labels Nov 25, 2019
@rartino
Copy link
Contributor

rartino commented Nov 25, 2019

Oh, right, good point.

Given that we now have very few 'default' fields, I've been thinking about changing the definition of response_fields to be "which non-default fields do you want to be included" and thus provide no mechanism of avoiding any default ones. Then id and type wouldn't need any special treatment. And I think from a user perspective this would be nicer.

@merkys
Copy link
Member Author

merkys commented Nov 25, 2019

Sounds great. It should really be more intuitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/has-concrete-suggestion This issue has one or more concrete suggestions spelled out that can be brought up for consensus. type/bug A bug or problem in the specification. Needs to be addressed quickly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants