-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Configuration properties binding bug with * in property name #24548
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
Labels
status: invalid
An issue that we don't feel is valid
Comments
On Spring Boot 2.2.10.RELEASE output is not same on each run. (I know it is an unsupported version, just wanted to make sure that my problem is not tied exclusively to the new version) E.g.
|
This is working as documented. Properties with special characters in their name must by wrapped in |
Thanks, sorry for opened issue, missed that part in documentation. |
quaff
added a commit
to quaff/spring-boot
that referenced
this issue
Oct 28, 2024
Given: ```yaml my: map: "/key": "value" ``` --- Before this commit: It's equivalent to ```yaml my: map: "[key]": "value" # "[/key]" is expected ``` Such counter-intuitive behavior will confuse developers, there are several reported issues, incomplete list: spring-projectsGH-41099 spring-projectsGH-29582 spring-projectsGH-24548 --- After this commit: ``` *************************** APPLICATION FAILED TO START *************************** Description: Failed to bind properties under 'my.map' to java.util.Map<java.lang.String, java.lang.String>: Reason: java.lang.IllegalArgumentException: Please rewrite key '/key' to '[/key]' and surround it with quotes if YAML is using Action: Update your application's configuration ``` --- See spring-projectsGH-42802
quaff
added a commit
to quaff/spring-boot
that referenced
this issue
Oct 28, 2024
Given: ```yaml my: map: "/key": "value" ``` --- Before this commit: It's equivalent to ```yaml my: map: "[key]": "value" # "[/key]" is expected ``` Such counter-intuitive behavior will confuse developers, there are several reported issues, incomplete list: spring-projectsGH-41099 spring-projectsGH-29582 spring-projectsGH-24548 --- After this commit: ``` *************************** APPLICATION FAILED TO START *************************** Description: Failed to bind properties under 'my.map' to java.util.Map<java.lang.String, java.lang.String>: Reason: java.lang.IllegalArgumentException: Please rewrite key '/key' to '[/key]' and surround it with quotes if YAML is using Action: Update your application's configuration ``` --- See spring-projectsGH-42802
quaff
added a commit
to quaff/spring-boot
that referenced
this issue
Oct 28, 2024
Given: ```yaml my: map: "/key": "value" ``` --- Before this commit: It's equivalent to ```yaml my: map: "[key]": "value" # "[/key]" is expected ``` Such counter-intuitive behavior will confuse developers, there are several reported issues, incomplete list: spring-projectsGH-41099 spring-projectsGH-29582 spring-projectsGH-24548 --- After this commit: ``` *************************** APPLICATION FAILED TO START *************************** Description: Failed to bind properties under 'my.map' to java.util.Map<java.lang.String, java.lang.String>: Reason: java.lang.IllegalArgumentException: Please rewrite key '/key' to '[/key]' and surround it with quotes if YAML is using Action: Update your application's configuration ``` --- See spring-projectsGH-42802
quaff
added a commit
to quaff/spring-boot
that referenced
this issue
Oct 28, 2024
Given: ```yaml my: map: "/key": "value" ``` --- Before this commit: It's equivalent to ```yaml my: map: "[key]": "value" # "[/key]" is expected ``` Such counter-intuitive behavior will confuse developers, there are several reported issues, incomplete list: spring-projectsGH-41099 spring-projectsGH-29582 spring-projectsGH-24548 --- After this commit: ``` *************************** APPLICATION FAILED TO START *************************** Description: Failed to bind properties under 'my.map' to java.util.Map<java.lang.String, java.lang.String>: Reason: java.lang.IllegalArgumentException: Please rewrite key '/key' to '[/key]' and surround it with quotes if YAML is using Action: Update your application's configuration ``` --- See spring-projectsGH-42802
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I have some configuration properties class which has
Map<String, Integer>
field. Key in map can contain*
for some ant path matching. If property source contains that keys, binder will bind them without*
characters and with unexpected values also.Here is minimal sample to reproduce this:
Note above that all properties which are bound from environment have same value
6
but in environment only one property has value6
.NOTE: I'm using Spring Boot 2.4.1
Regards,
The text was updated successfully, but these errors were encountered: