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

Add guidance on how to specify a default sub-resource #11

Open
a-akimov opened this issue Oct 19, 2022 · 0 comments
Open

Add guidance on how to specify a default sub-resource #11

a-akimov opened this issue Oct 19, 2022 · 0 comments

Comments

@a-akimov
Copy link
Member

Use case:

When a parent resource has a collection of sub-resources, sometimes there is a need to specify which one is the default. For example, there might be multiple shipping address, and one of them should be used by default.

Possible options here:

  1. Store the default_address_id in a parent resource and validate it.
  2. Store the boolean default field within each sub-resource and make an explicit /make_default action to update it.
  3. Store the boolean default field within each sub-resource and use PATCH to update it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant