Skip to content

Add capabilities for prefixing WebMvcLinkBuilder? #1221

Open
@onacit

Description

@onacit

Please see https://stackoverflow.com/q/60680748/330457.

I'm trying to make my controllers prefixed with, say, /api/v1.

And it seems WebMvcLinkBuilder#linkTo(Class<?>) method is not aware of PathMatchConfigurer#addPathPrefix(String, Predicate<Class<?>>).

Can anybody please add some capability of adding prefixes to WebMvcLinkBuilder?

WebMvcLinkBuilder
//        .prefix("api")
//        .prefix("v1")
//        .prefixes("api", "v1")
//        .linkTo(controller)
//        .linkTo(controller, "api", "v1")
        .linkTo(controller)
        .withPrefixes("api", "v1")
;

Or do I have already an intrinsic way to do this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions