Document consistent not-found responses for Items and Bitstreams - #375
Open
Zsolt05 wants to merge 1 commit into
Open
Document consistent not-found responses for Items and Bitstreams#375Zsolt05 wants to merge 1 commit into
Zsolt05 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the REST contract documentation to clarify and standardize the HTTP status codes returned by the single Item and Bitstream endpoints, particularly around when 401/403 vs 404 should be expected.
Changes:
- Clarifies
/api/core/items/<:uuid>status-code semantics to distinguish auth/permission failures from missing/malformed/mismatched identifiers. - Adds a new “Status codes” section for
/api/core/bitstreams/<:uuid>documenting the same semantics.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| items.md | Updates the single-item endpoint status code descriptions to align with the documented “consistent not-found responses” contract. |
| bitstreams.md | Introduces a status code list for single-bitstream endpoints describing when 200/401/403/404 are returned. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+96
to
+98
| * 401 Unauthorized - if the item exists, but you are not authenticated and it is not visible to anonymous users | ||
| * 403 Forbidden - if the item exists, but you are not logged in with sufficient permissions. Please note that withdrawn items are visible to everyone without any metadata details | ||
| * 404 Not Found - if the identifier is malformed, the item doesn't exist, or the UUID belongs to a different type of DSpace object |
Comment on lines
+36
to
+41
| Status codes: | ||
| * 200 OK - if the bitstream is found and its metadata is visible to the current user or the anonymous user | ||
| * 401 Unauthorized - if the bitstream exists, but you are not authenticated and its metadata is not visible to anonymous users | ||
| * 403 Forbidden - if the bitstream exists, but you are not logged in with sufficient permissions to see its metadata | ||
| * 404 Not Found - if the identifier is malformed, the bitstream doesn't exist, or the UUID belongs to a different type of DSpace object | ||
|
|
This was referenced Aug 11, 2026
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.
References
Related to DSpace/DSpace#10099
Related to DSpace/DSpace#12954
Description
Documents the HTTP status codes returned by the single Item and Bitstream endpoints.
The contract now specifies that:
404 Not Foundis returned when the identifier is malformed;404 Not Foundis returned when the requested object does not exist;404 Not Foundis returned when the UUID belongs to a different type of DSpace object;401 Unauthorizedand403 Forbiddenapply only when the requested resource exists but its metadata is not accessible to the requester.Changes
/api/core/items/<:uuid>initems.md./api/core/bitstreams/<:uuid>inbitstreams.md.Verification
git diff --checkpasses.