Expressions.SimpleExpression#expandMap stringifies each entry value, so {;params} with a Map does not expand a collection or array entry.
On master (68b96d1), UriTemplate.create("/server{;parameters}", UTF_8).expand(...):
parameters |
expanded |
{colours=[red, blue], size=L} |
/server;colours=%5Bred%2C%20blue%5D;size=L |
{colours=String[]{"red","blue"}} |
/server;colours=%5BLjava.lang.String%3B%403567135c |
As a top-level variable the same values go through expandIterable: {;colours} with List.of("red","blue") gives /server;colours=red;colours=blue. A map entry should expand the same way, giving /server;colours=red;colours=blue;size=L.
The array case also puts an identity hash in the URL.
Found from spring-cloud/spring-cloud-openfeign#1421.
Expressions.SimpleExpression#expandMapstringifies each entry value, so{;params}with aMapdoes not expand a collection or array entry.On master (68b96d1),
UriTemplate.create("/server{;parameters}", UTF_8).expand(...):parameters{colours=[red, blue], size=L}/server;colours=%5Bred%2C%20blue%5D;size=L{colours=String[]{"red","blue"}}/server;colours=%5BLjava.lang.String%3B%403567135cAs a top-level variable the same values go through
expandIterable:{;colours}withList.of("red","blue")gives/server;colours=red;colours=blue. A map entry should expand the same way, giving/server;colours=red;colours=blue;size=L.The array case also puts an identity hash in the URL.
Found from spring-cloud/spring-cloud-openfeign#1421.