spring-projects / spring-projects/spring-data-rest
BoundMethodParameter in AnnotatedParametersParameterAccessor must allow custom converters to be added [DATAREST-1084]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Kollivakkam Raghavan opened DATAREST-1084 and commented
We have a requirement where a path parameter is a uuid that is a string composed of two parts. I use a DataBinder to split each part into a Java object. When the REST controller forms the link using the linkTo method it fails because it does not find a converter to convert my UUID class to a string.
The AnnotatedParametersParameterAccessor.BoundParameter class does not provide for a way to add custom converters to allow converting the object back to its string representation.
Example:
// Some comments here
@RequestMapping(path="/api/{customuuid}")
public String getFoo(@PathVariable("customuuid") MyCustomClass customUuid)
{
// your business logic here
// form self link here (this fails with no converter found because DefaultConversionService is assumed)
Link selfLink = linkTo(methodOn(MyRestController.class)
.getFoo(customUuid))
.withSelfRel();
}
No further details from DATAREST-1084
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.
Assessment
This issue has not been assessed yet.