spring-projects / spring-projects/spring-data-rest
Better handling of calls to RepositoryEntityLinks.slash(…) [DATAREST-76]
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-76 and commented
Currently the implementation of RepositoryEntityLinks.slash(…) has a few shortcomings. It currently uses builder.pathSegment(…) which means that Strings starting with a slash will be prepended as is. This might result in duplicate slashes and query parameters and fragment included in the given String not discovered as such.
It's probably better to build a UriComponents from the String representation of the given object and add the relevant parts to the current builder:
UriCopmponents components = UriComponentsBuilder.fromUriString(path).build();
for (String pathSegment : components.getPathSegments()) {
builder.pathSegment(pathSegment);
}
builder.query(components.getQuery());
builder.fragments(components.getFragment());
No further details from DATAREST-76
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 at RepositoryEntityLinks.slash(…) and trace its current pathSegment handling, then inspect the UriComponents and UriComponentsBuilder APIs mentioned in the issue. Done means leading slashes do not create duplicates and query parameters and fragments in the supplied String are handled separately by the resulting URI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100