-
-
Notifications
You must be signed in to change notification settings - Fork 91
Support null in content PATCH to delete a field value #187 #513
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
Conversation
tisto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I would like @lukasgraf to have a second look though if possible.
lukasgraf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two minor comments, otherwise looks good to me. 👍
I pretty much had to make my peace with the fact that handling of default values and missing values is somewhat broken in Plone itself, and there's only so much we can do about that in plone.restapi.
Resetting the field to missing_value and documenting it as such feels like the least bad thing to do, and is what would meet people's expectations the most I would think.
| ), | ||
| 'Setting it to null is not allowed.' | ||
| ), | ||
| 'error': None}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, 'error': None feels a bit clunky. I don't have a clear suggestion in mind though.
docs/source/content.rst
Outdated
| PATCH allows to provide just a subset of the resource | ||
| (the values you actually want to change). | ||
|
|
||
| If you send the value `null` for a field, the field's content will be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In reStructuredText these need to be double backticks (``) for code literals, single backticks are just emphasis 😉
This fixed #187