Skip to content

Document consistent not-found responses for Items and Bitstreams - #375

Open
Zsolt05 wants to merge 1 commit into
DSpace:mainfrom
Zsolt05:docs/10099-consistent-not-found-responses
Open

Document consistent not-found responses for Items and Bitstreams#375
Zsolt05 wants to merge 1 commit into
DSpace:mainfrom
Zsolt05:docs/10099-consistent-not-found-responses

Conversation

@Zsolt05

@Zsolt05 Zsolt05 commented Aug 11, 2026

Copy link
Copy Markdown

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 Found is returned when the identifier is malformed;
  • 404 Not Found is returned when the requested object does not exist;
  • 404 Not Found is returned when the UUID belongs to a different type of DSpace object;
  • 401 Unauthorized and 403 Forbidden apply only when the requested resource exists but its metadata is not accessible to the requester.

Changes

  • Clarify the status codes for /api/core/items/<:uuid> in items.md.
  • Add the status codes for /api/core/bitstreams/<:uuid> in bitstreams.md.

Verification

  • git diff --check passes.
  • The documented responses are covered by the corresponding backend integration tests.

Copilot AI lite review requested due to automatic review settings August 11, 2026 11:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread items.md
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 thread bitstreams.md
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

@lgeggleston lgeggleston added bug port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release port to dspace-10_x This PR needs to be ported to `dspace-10_x` branch for next bug-fix release labels Aug 11, 2026
@lgeggleston lgeggleston moved this to 🙋 Needs Reviewers Assigned in DSpace 11.0 Release Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release port to dspace-10_x This PR needs to be ported to `dspace-10_x` branch for next bug-fix release

Projects

Status: 🙋 Needs Reviewers Assigned

Development

Successfully merging this pull request may close these issues.

3 participants