Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebMvcLinkBuilder does not resolve "EmmbeddedValues" correctly. #1855

Open
FlameDuck opened this issue Sep 16, 2022 · 0 comments
Open

WebMvcLinkBuilder does not resolve "EmmbeddedValues" correctly. #1855

FlameDuck opened this issue Sep 16, 2022 · 0 comments

Comments

@FlameDuck
Copy link

When using "Embedded Values" in spring, WebMvcLinkBuilder does not correctly resolve the value. This does not seem to be an esoteric way of writing a RestController, as among other things this is how the OpenAPI generator generates server stubs.

Example:

@RestController
@RequestMapping("${openapi.example.base-path:/example}")
public class HelloController {
}

Failing Test:

@Test
void LinkBuilderAndSpringEmbeddedValueResolver() {
    var result = WebMvcLinkBuilder.linkTo(HelloController.class)
                    .withRel("example");
    assertThat(result).extracting(Link::getHref).isEqualTo("http://localhost/example");
}

Result:

expected: "http://localhost/example"
 but was: "http://localhost/example}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant