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

Clarify interaction of fields and default #533

Closed
dehora opened this issue Sep 2, 2019 · 5 comments · Fixed by #546
Closed

Clarify interaction of fields and default #533

dehora opened this issue Sep 2, 2019 · 5 comments · Fixed by #546
Assignees

Comments

@dehora
Copy link
Member

dehora commented Sep 2, 2019

It's not clear whether the fields parameter is intended to have a default (at the level of design), or if it's intended to be used only to create partials from a whole. As things stand in the guidelines, it seems to not be an incorrect approach technically speaking. to combine the two so as to allow a resource using fields to return a partial object by default.The follow on implication is an API designer using these guidelines can require a client that wants to obtain a whole object to ask for every field at every level of depth.

@tkrop
Copy link
Member

tkrop commented Sep 10, 2019

I think this is related to #483, because if fields is combined with default it pretty much renders embed useless. May be we should than focus on one rule for both aspects. I would favor fields than.

@meshcalero what do you think?

@whiskeysierra
Copy link
Contributor

if fields is combined with default it pretty much renders embed useless

Can you elaborate on that?

@ePaul
Copy link
Member

ePaul commented Sep 24, 2019

From the Guild meeting

Having a default value for the fields parameter is confusing, because as the result you won't get from the API whatis specified in the model, but just some subset of it, and first need to check the parameter's default value (which might even be different between endpoints) to figure out what's going on.

@tkrop tkrop self-assigned this Sep 24, 2019
@ePaul
Copy link
Member

ePaul commented Oct 22, 2019

To add to the guideline:

  • default value for this parameter is counter-intuitive, and should not be used

We also discussed whether it might make sense to make this parameter required, but didn't come to an agreement here. So for now we don't add anything about this to the guidelines.

@whiskeysierra
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants