Skip to content

Support mapping of method params to templated link params #18

@hdpe

Description

@hdpe

Following implementation of #16, which allows resolution of templated links from method parameters, the templated link parameters and method parameters are assumed to be in the same order, i.e. for

{
    "_links": {
        "findByCriteria": {
            "href": "http://blah/items/search/findByCriteria{?name,quest,favouriteColour}",
            "templated": true
        }
    }
}

The method signature matching this endpoint must be exactly:

@LinkedResource Item findByCriteria(String name, String quest, String favouriteColour);

We should introduce a @LinkParam annotation targeting method parameters to allow mapping of the method parameters to their corresponding templated link parameter, so we could write:

@LinkedResource Item findByCriteria(
  @LinkParam("favouriteColour") String c,
  @LinkParam("quest") String q,
  @LinkParam("name") String n);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions