-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
regressionBugs and issues related to unintended breaking changesBugs and issues related to unintended breaking changesspring-cloudIssues related to Spring Cloud OpenFeignIssues related to Spring Cloud OpenFeign
Description
Background
In #778, there were some modifications in RequestTemplate
, affecting query parameter resolution. As a result, empty query parameters are being filtered out. On the other hand, according to RFC 6570, empty query parameters are allowed, but with this change, Feign cannot handle this anymore.
Example
Let's suppose we have this client:
public interface DemoClient {
@RequestMapping(path = "/test", method = RequestMethod.GET)
String test(@RequestParam("param") String param);
}
Then the following assertion (using WireMock) is true:
@Test
public void testNonEmptyParam() {
demoClient.test("asd");
wireMockServer.verify(getRequestedFor(urlPathEqualTo("/test")).withQueryParam("param", equalTo("asd")));
}
While this is not:
@Test
public void testEmptyParam() {
demoClient.test("");
wireMockServer.verify(getRequestedFor(urlPathEqualTo("/test")).withQueryParam("param", equalTo("")));
}
See my respository for full project.
Expected behavior
Empty strings are sent as empty query parameters, such as:
http://localhost:8080/test?param=
Metadata
Metadata
Assignees
Labels
regressionBugs and issues related to unintended breaking changesBugs and issues related to unintended breaking changesspring-cloudIssues related to Spring Cloud OpenFeignIssues related to Spring Cloud OpenFeign