Skip to content

Add support for @GetMapping, @PostMapping etc. introduced in Spring 4.3 in ControllerLinkBuilder #471

@xak2000

Description

@xak2000

Now if controller has @GetMapping("/some/path/{id}") then this exception occurs:

java.lang.IllegalArgumentException: 'uriTemplate' must not be null
    at org.springframework.util.Assert.hasText(Assert.java:168) ~[spring-core-4.3.1.RELEASE.jar:4.3.1.RELEASE]
    at org.springframework.web.util.UriTemplate.<init>(UriTemplate.java:61) ~[spring-web-4.3.1.RELEASE.jar:4.3.1.RELEASE]
    at org.springframework.hateoas.mvc.ControllerLinkBuilderFactory.linkTo(ControllerLinkBuilderFactory.java:134) ~[spring-hateoas-0.20.0.RELEASE.jar:na]
    at org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo(ControllerLinkBuilder.java:172) ~[spring-hateoas-0.20.0.RELEASE.jar:na]

If I change this mapping to @RequestMapping(path = "/some/path/{id}", method = RequestMethod.GET) then all works fine.

Versions used: spring-boot-starter-hateoas 1.4.0.RC1, spring-hateaos 0.20.0.RELEASE, spring 4.3.1.RELEASE.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions