Skip to content

BoundMethodParameter using it's own conversion service #426

Closed
@kkondratov

Description

@kkondratov

Using a ControllerLinkBuilder to build links to methods on RestControllers i.e.:

linkTo(methodOn(TestController.class).get(entity.getId())).withSelfRel()

Results in the AnnotatedParametersParameterAccessor parsing all the method parameters to strings when creating the links. When one uses a non standard object i.e. CompositePK this goes wrong since the DefaultFormattingConversionService does not know how to convert a CompositePK to a string. this results in an exception.

It is desirable that the BoundMethodParameter is instantiated with Springs conversion service if one is present and fall back to the DefaultFormattingConversionService. This way when a conversion has to take place between objects not registered by default like a CompositePK, and the converter is registered in springs conversion registry, the conversion will take place instead of throwing an exception.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions