【发布时间】:2020-01-27 14:07:59
【问题描述】:
从2.1.1 版本更新到2.1.2 版本后,spring-cloud-openfeign-core 出现问题。
当我使用空参数执行调用时,它总是将其名称添加到以前不是这种情况的查询字符串中。
2.1.1 中生成的 url 是 http://test.url/endpoint,但在 2.1.2 中它变成了 http://test.url/endpoint?id,最后是 ?id。
// request
myFeignClient.myGetRequest(List.of())
// client
@FeignClient(name = "client", url = "http://test.url/")
public interface MyFeignClient {
@RequestLine("GET /endpoint?id={id}")
Object get(@Param(value = "id") List<String> id);
}
有什么办法可以去掉空参数名?
【问题讨论】: