Skip to content

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

@lmtoo

Description

@lmtoo

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

Activity

agbilotia1998

agbilotia1998 commented on Dec 10, 2020

@agbilotia1998

Observing same issue, any workaround for this?

agbilotia1998

agbilotia1998 commented on Dec 11, 2020

@agbilotia1998

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

jpoisso

jpoisso commented on Jan 28, 2022

@jpoisso

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

chakradev

chakradev commented on May 23, 2022

@chakradev

please share workaround if any

ckdrunix

ckdrunix commented on Nov 9, 2023

@ckdrunix

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lmtoo@agbilotia1998@jpoisso@ckdrunix@chakradev

        Issue actions

          WebMvcLinkBuilder's linkTo and methodOn doesn't evaluate ${} · Issue #1360 · spring-projects/spring-hateoas