Skip to content

Document Location headers for created REST resources - #369

Merged
tdonohue merged 2 commits into
DSpace:mainfrom
pratyushsinghal7:issue-8881-contract
Oct 7, 2026
Merged

tdonohue merged 2 commits into
DSpace:mainfrom
pratyushsinghal7:issue-8881-contract

Conversation

@pratyushsinghal7

Copy link
Copy Markdown
Contributor

References

Description

Document that successful JSON collection-resource creation returns 201 Created with an absolute Location header for the created resource.

The EPerson creation contract now includes the concrete canonical URI shape returned by POST /api/eperson/epersons.

Validation

Specify the shared JSON creation response header and the canonical EPerson URI returned after successful account creation.
Comment thread epersons.md
@lgeggleston lgeggleston added bug 1 APPROVAL pull request only requires a single approval to merge. authentication: EPerson Related to how the EPerson object works during authentication labels Jul 24, 2026
@lgeggleston lgeggleston moved this to 👀 Under Review in DSpace 11.0 Release Jul 24, 2026
@pratyushsinghal7

Copy link
Copy Markdown
Contributor Author

@saschaszott the review feedback has been addressed in 3e89c41 — the repository-wide 201/Location contract is now in README.md, and all three EPerson POST variants in epersons.md document the returned Location URI. The companion code PR DSpace/DSpace#12848 already has two approvals (yours and @MMilosz's) and is only waiting on this contract PR, so a re-review here would be much appreciated. Thanks!

@saschaszott

Copy link
Copy Markdown
Contributor

@pratyushsinghal7 , I am not sure whether my concern has been addressed. Your change to the RestResourceController base class affects not only the creation of new EPersons via POST, but ultimately all DSOs created through postJsonInternal. My point was therefore whether this change should also be documented elsewhere in the RestContract (specifically, that the Location header contains the URI of the created resource).

@tdonohue tdonohue added this to the 11.0 milestone Oct 7, 2026

@tdonohue tdonohue left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 Thanks @pratyushsinghal7 ! This looks "good enough" to me, especially since the new Location header is now mentioned in the general README.md.

I do think we could follow this PR up with additional cleanup work to document every 201 that now returns a Location header, but this is good enough for now.

@tdonohue tdonohue added 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 Oct 7, 2026
@tdonohue
tdonohue merged commit 06630fc into DSpace:main Oct 7, 2026
1 check passed
@dspace-bot

Copy link
Copy Markdown

Backport failed for dspace-8_x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin dspace-8_x
git worktree add -d .worktree/backport-369-to-dspace-8_x origin/dspace-8_x
cd .worktree/backport-369-to-dspace-8_x
git switch --create backport-369-to-dspace-8_x
git cherry-pick -x 07e9e1e0adbdb2d5b2fac12014ebc6e50c9a0d0c 3e89c412342c15e2c2830a055a85046352e3afc8

@dspace-bot

Copy link
Copy Markdown

Successfully created backport PR for dspace-9_x:

@dspace-bot

Copy link
Copy Markdown

Successfully created backport PR for dspace-10_x:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge. authentication: EPerson Related to how the EPerson object works during authentication 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: ✅ Done

Development

Successfully merging this pull request may close these issues.

5 participants