spring-hateoas icon indicating copy to clipboard operation
spring-hateoas copied to clipboard

WebMvcLinkBuilder's linkTo and methodOn doesn't evaluate ${}

Open lmtoo opened this issue 4 years ago • 5 comments

I defined a RestController ,which annotated with @RequestMapping("${infrastructure.endpoints.project.base-path:/api/v1/projects}") , but when I use this controller to generate Link , list.add(linkTo(methodOn(ProjectController.class).list()).withRel(PROJECTS)); I got link like this

"projects": { "href": "http://localhost:8085/inspection${infrastructure.endpoints.project.base-path:/api/v1/projects}" },

infrastructure.endpoints.project.base-path did'nt evaluate with the Environment

lmtoo avatar Sep 08 '20 02:09 lmtoo

Observing same issue, any workaround for this?

agbilotia1998 avatar Dec 10 '20 12:12 agbilotia1998

Hi @lmtoo the issue seems to be resolved in hateoas version 1.2.2 maybe you can try using that.

agbilotia1998 avatar Dec 11 '20 11:12 agbilotia1998

We're having the same issue in 1.4.0 as well.

jpoisso avatar Jan 28 '22 21:01 jpoisso

please share workaround if any

chakradev avatar May 23 '22 14:05 chakradev

If you are using spring boot PR #1411 (not yet merged) probably would adress this issue

ckdrunix avatar Nov 09 '23 17:11 ckdrunix