Repository navigation
Fix/put attributes single body - #478
Merged
Merged
Conversation
PUT /{collection}/{id}/attributes only reads attributes from an
"attributes" map, which openapi.yml marks as required. A body without
one - including the single-attribute form {"name": ..., "type": ...,
"value": ...} that 0.9.x also accepted on this route - produced an
empty attribute set, which was forwarded to the data node and answered
with 200. The client was told the write succeeded and nothing was
stored.
Now the single-object form returns 400 when the body yields no
attributes, matching the obj_ids list form, which already did. An
obj_ids map entry without an "attributes" key also returns 400.
Previously that object was skipped while the others were written. An
entry with an empty map is still skipped, since a batch request may
include objects with nothing to add.
This does not bring back the single-attribute body on the collection
route. openapi.yml doesn't list it, and h5pyd never used it. Whether
to restore it is an API decision outside the scope of this fix.
CHANGELOG.md still described 1.0.1, which is released and keeps its own copy in the v1.0.1 tag. Reset it for 1.0.2 (unreleased) and add the first bug fix entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PUT /{collection}/{id}/attributes only reads attributes from an
"attributes" map, which openapi.yml marks as required. A body without
one - including the single-attribute form {"name": ..., "type": ...,
"value": ...} that 0.9.x also accepted on this route - produced an
empty attribute set, which was forwarded to the data node and answered
with 200. The client was told the write succeeded and nothing was
stored.
Now the single-object form returns 400 when the body yields no
attributes, matching the obj_ids list form, which already did. An
obj_ids map entry without an "attributes" key also returns 400.
Previously that object was skipped while the others were written. An
entry with an empty map is still skipped, since a batch request may
include objects with nothing to add.
This does not bring back the single-attribute body on the collection
route. openapi.yml doesn't list it, and h5pyd never used it. Whether
to restore it is an API decision outside the scope of this fix.