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

Updating a resource to null/remove a field #34

Open
duglin opened this issue Oct 29, 2018 · 3 comments
Open

Updating a resource to null/remove a field #34

duglin opened this issue Oct 29, 2018 · 3 comments

Comments

@duglin
Copy link

duglin commented Oct 29, 2018

PATCH is used to update a resource and missing fields of the request are treated as "non-changed" fields - we should then provide a mechanism to delete (or null out) a field. I would suggest that passing in "null" to mean null out a field - and I would make a "null" value for a field the same as deleting the field. I'm not sure there's value in an optional field being there with a value of "null".

@KirilKabakchiev
Copy link
Member

Do we have usecases for nulling out fields? I can see value only when we talk about labels/ parameters (to remove a label or to remove a particular value of a label) but that should be already supported by the suggested approach to patch labels.

P.S. It's also debatable if the way suggested currently is the best to patch labels or managing labels as a subresource API would be better.

@duglin
Copy link
Author

duglin commented Oct 29, 2018

Any optional field (even if its an extension) might need to be null'd out (or removed) - so we need a way to support it.

@KirilKabakchiev
Copy link
Member

Details about this should be now present as part of #31.

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

2 participants