Skip to content

Allow creation of UriTemplates when pointing to controller methods. #169

Closed
@Gotusso

Description

@Gotusso

Would be nice to have an easy way of return URL templates directly. For instance, suppose we have a method like

@RequestMapping
public HttpEntity<ListResource> list(
        @RequestParam(value = "query", required = false) String query,
        @RequestParam(value = "page", defaultValue = "1") Integer page,
        @RequestParam(value = "limit", defaultValue = "10") Integer limit) {
    // ...
}

I can reference an specific invocation with linkTo(methodOn(Controller.class).list("foo", 1, 20) but I think there is no easy way to reference a generic call without specifing the method parameters. Invoking with null results in a exception.

I would like to get something like

{
    rel: "list"
    href: "http://localhost:8080/myresource{?query,page,limit}"
}

Is that possible?
Regards

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