Browse Source
Fixes #872 Previously, all unresolved query template expressions resolved to empty strings, which then indcate that the entire query parameter should be removed. This violates RFC 6570 in that only undefined values should be removed. This change updates Query Template to check the provided `variables` map for an entry expression. If no value is provided, the entry is explicitly marked `UNDEF` and removed. This brings us in line with the specification. The following is now how parameters are resolved: *Empty String* ```java public void test() { Map<String, Object> parameters = new LinkedHashMap<>(); parameters.put("param", ""); this.demoClient.test(parameters); } ``` Result ``` http://localhost:8080/test?param= ``` *Missing* ```java public void test() { Map<String, Object> parameters = new LinkedHashMap<>(); this.demoClient.test(parameters); } ``` Result ``` http://localhost:8080/test ``` *Undefined* ```java public void test() { Map<String, Object> parameters = new LinkedHashMap<>(); parameters.put("param", null); this.demoClient.test(parameters); } ``` Result ``` http://localhost:8080/test ``` * Adding additional test case for explicit null parameter value * Additional Test case for the explict `null` case. Updates to the documentation.pull/918/head
Kevin Davis
6 years ago
committed by
Marvin Froeder
5 changed files with 107 additions and 15 deletions
Loading…
Reference in new issue