Skip to content

Parameter names not detected in case @AliasFor'ed attributes are used #617

@caoyuanqi

Description

@caoyuanqi

the code like below,

@RequestMapping(value = "/account/{accountName}",method =RequestMethod.GET)
    public AccountResource getAccountInfo(@P("u") @PathVariable String accountName) {
        AccountResource resource = new AccountResource();
        Account account = accountService.getAccountInfo(accountName);
        resource.setAccountName(account.getAccountName());
        resource.setType(account.getType());
        String investorId = account.getInvestor().getId();
        log.info("investor id is " + investorId);
        Link selfLink = linkTo(methodOn(AccountController.class)
                .getAccountInfo(accountName)).withSelfRel();
        Link investorLink = linkTo(methodOn(InvestorController.class).getInverstor(investorId)).withRel("investor");
       // Link investorLink = new Link(baseUrl + serviceUrl
        //        + "/investor/" + investorId).withRel("investor");
        resource.add(selfLink);
        resource.add(investorLink);
        if (accountService.getInvestmentProfile(accountName) != null){
            Link investmentProfileLink = new Link(baseUrl + serviceUrl
                    + "/" + accountName + "/profile").withRel("mandate");
            resource.add(investmentProfileLink);
        }
        return resource;
    } 

Return Json is

{
  "type": "investor",
  "accountName": "cc1502762479261",
  "_links": {
    "self": {
      "href": "http://localhost:2222/accounts/account/ccxxxxxxxxx"
    },
    "investor": {
      "href": "http://localhost:2222/accounts/investor/{id}",
      "templated": true
    },
    "mandate": {
      "href": "http://localhost:9191/accounts/ccxxxxxxxxxx/profile"
    }
  }
}

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions