Skip to content

Fix/put attributes single body - #478

Merged
mattjala merged 2 commits into
masterfrom
fix/put-attributes-single-body
Oct 2, 2026
Merged

mattjala merged 2 commits into
masterfrom
fix/put-attributes-single-body

Conversation

@mattjala

@mattjala mattjala commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

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.

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.
@mattjala mattjala added this to the HSDS 1.1.0 milestone Oct 2, 2026
@mattjala mattjala added the bug label Oct 2, 2026
@github-project-automation github-project-automation Bot moved this to To be triaged in HSDS - TRIAGE & TRACK Oct 2, 2026
@mattjala
mattjala merged commit f5b4586 into master Oct 2, 2026
49 checks passed
@mattjala
mattjala deleted the fix/put-attributes-single-body branch October 2, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

1 participant