spring-projects / spring-projects/spring-data-rest
baseUri handling broken [DATAREST-84]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Oliver Drotbohm opened DATAREST-84 and commented
Suppose we have a DispatcherServlet registered to bootstrap SD REST configuration and mapped to /. Our Spring Data REST configuration adds a baseUri of api. This results in the following:
- browse to
/and you still get the repositories listed. Expected:/should not be handled by Spring Data REST,/api/should. - the response for
/returns links correctly prepended with/api/but following them results in a 404.
Both of the issues seem to be rooted in RepositoryRestHandlerMapping. It exposes the root resource for an empty request URI where it should do so for the baseUri if configured. For a call to a repository URI, the usage of the ResourceMapping does not consider the baseUri neither
Affects: 1.1.0.M1
1 votes, 3 watchers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with RepositoryRestHandlerMapping and the ResourceMapping usage described in the issue. Reproduce the configured baseUri scenario with a DispatcherServlet mapped to /, then verify that / is not handled, /api/ serves the root resource, and repository links resolve instead of returning 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100