Skip to content

Path-style expansion does not expand collection values inside a map #3584

Description

@kdelay

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions