Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of entries no longer preserved in Map field of @ConfigurationProperties type when bound from YAML #21670

Closed
jkuipers opened this issue Jun 3, 2020 · 2 comments
Labels
status: duplicate A duplicate of another issue

Comments

@jkuipers
Copy link

jkuipers commented Jun 3, 2020

After updating to Boot 2.3.0, ordering of entries in a Map-based field in an @ConfigurationProperties-annotated class as specified in application.yml are no longer preserved.
This breaks Spring Cloud Zuul when a user specifies multiple routes with overlapping paths where order is critical. Cloud's docs explicitly state that order is guaranteed to be preserved when using YAML:
https://cloud.spring.io/spring-cloud-netflix/multi/multi__router_and_filter_zuul.html#netflix-zuul-reverse-proxy (last section of that paragraph).

Here's a app with a failing test to reproduce the issue:
entries-order.zip
The test fails on my machine, running Windows and OpenJ9 Java 11.

I have not attempted to investigate what change in Boot caused this behavior, so I'm not sure if my OS or Java version are involved, but I'm quite confident that it's a regression in Boot that should be fixed.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 3, 2020
@wilkinsona
Copy link
Member

Thanks, @jkuipers. This is a duplicate of #21470.

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 3, 2020
@jkuipers
Copy link
Author

jkuipers commented Jun 3, 2020

Ah, should've searched before reporting. Thanks, glad that this will be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants