I don't know what I'm doing wrong, but each time feign client converts method declared as get to post type.
@FeignClient(name = "my-service", url = "http://localhost:8114", path = "service")
public interface MyServiceClient {
@RequestMapping(method = GET, value = "/clients")
Client getClients(@QueryMap MyPojo pojo);
}
@Getter
@Setter
public class MyPojo {
@NotNull
private String someValue;
@NotNull
private SomeEnum someEnum;
}
This setup should be resolved to this request:
GET http://localhost:8114/service/clients?someValue=foo&someEnum=bar
But each time I'm getting this result:
{
"timestamp": 1542378765498,
"status": 405,
"error": "Method Not Allowed",
"exception": "org.springframework.web.HttpRequestMethodNotSupportedException",
"message": "Request method 'POST' not supported",
"path": "/service/clients"
}
However it works fine when I do it in this way:
@RequestMapping(method = GET, value = "/clients?someValue=foo&someEnum=bar")
Client getClients();
I'm working on spring-cloud-starter-feign 1.2.7.RELASE version which contains, feign-core/sl4fj/hystrix/ 9.3.1 version, but I also tested it on 10.1.0 version, with this same result.
What should I do to resolve this issue?