Commit aec8451
Register CLARIN link repositories under plural model names (DSpace 9 contract)
Six CLARIN LinkRestRepository beans are still registered under the singular model
name, so all six advertised sub-resources return 404 on the v9 base while they
return 200 on 7.6.5.
DSpace 7 singularized the URL segment before the bean lookup --
Utils.getLinkResourceRepository() called makeSingular(modelPlural). DSpace 9
removed that step and looks the bean up under the plural segment verbatim, so a
link repository must now be registered as <category>.<typePlural>.<rel>. The
upstream migration renamed its own 71 link repositories accordingly and added
PLURAL_NAME to the REST models, but these six CLARIN ones were missed.
Note ClarinLicenseResourceUserAllowanceRestRepository (the MAIN repository) *was*
migrated to PLURAL_NAME, which is why GET /core/clarinlruallowances/242 returns
200 while every one of its rels 404s. Migrating a main repository without its
link repositories leaves all its sub-resources dead.
Why this is easy to misread: a missing bean raises RepositoryNotFoundException,
and a missing route resolves BEFORE any authorization check. The one defect
therefore surfaces as "404 != 200" for an admin, "404 != 401" for anonymous and
"404 != 403" for a non-owner -- it reads like an authorization problem, and the
404 body names the plural type that is not how the bean is registered:
{"status":404,"message":"The repository type core.clarinlruallowances was not found"}
Meanwhile the allowance JSON keeps advertising all three _links, so the API
describes endpoints it cannot serve.
Measured, admin token, dev-6.pc:8603 (9.3) vs dev-5.pc:88 (7.6.5):
core/clarinlruallowances/242 200 200
core/clarinlruallowances/242/userMetadata *404* 200
core/clarinlruallowances/242/userRegistration *404* 200
core/clarinlruallowances/242/resourceMapping *404* 200
core/clarinuserregistrations/1/userMetadata *404* 200
core/clarinuserregistrations/1/clarinLicenses *404* 200
core/clarinlicenseresourcemappings/1383/clarinLicense *404* 200
Audit backing the "six and only six" claim: of 77 LinkRestRepository
implementations on this branch, 71 already use PLURAL_NAME, these 6 used NAME,
and none uses a literal bean-name string. Every main (non-link) repository is
already plural. So this closes the gap completely.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent ea8b872 commit aec8451
6 files changed
Lines changed: 6 additions & 6 deletions
File tree
- dspace-server-webapp/src/main/java/org/dspace/app/rest/repository
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments