Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Add supports of generics on RestTemplate #220

Description

@DayS

With a rest method like this :

@Post("/user/infos")
ResponseEntity<String> sendUserInfos(Map<String, Object> infos);

AA will generate this method :

@Override
public ResponseEntity<String> sendUserInfos(Object>infos) {
    HttpHeaders httpHeaders = new HttpHeaders();
    HttpEntity<Object>> requestEntity = new HttpEntity<Object>>(infos, httpHeaders);
    return restTemplate.exchange("http://localhost:8081/epod/rest-services/user/infos", HttpMethod.POST, requestEntity, String.class);
}

But if we change the rest method for this one (without generics) :

@Post("/user/infos")
ResponseEntity<String> sendUserInfos(Map infos);

The generated class will be fine :

@Override
public ResponseEntity<String> sendUserInfos(Map infos) {
    HttpHeaders httpHeaders = new HttpHeaders();
    HttpEntity<Map> requestEntity = new HttpEntity<Map>(infos, httpHeaders);
    return restTemplate.exchange("http://localhost:8081/epod/rest-services/user/infos", HttpMethod.POST, requestEntity, String.class);
}

Activity

  1. pyricau commented on Jun 4, 2012

    @pyricau
    Contributor

    Thank you for reporting this, it's clearly a bug.

  2. DayS commented on Nov 14, 2012

    @DayS
    ContributorAuthor

    This problem should be solved in issue #330. I'm closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions