-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Improve document to elaborate why the slash in the map key will be removed #42802
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
Comments
Further more, if possible, I think it should raise error with meaningful message instead of removing characters silently. |
We documented when and why the special bracket notation is needed in #13506. This was then refined in #23390. I don't think we should get into the why in the reference documentation. My feeling is that it's a level of detail that the vast majority of users don't need and it will make the documentation unnecessarily verbose. Let's see what the rest of the team thinks. |
I agree with Andy. I think we should document the observable behavior, and not necessarily the why. |
How about adding a link to #23390? |
We shouldn't link the issue tracker from our reference doc. I also think that it would make the doc unnecessarily verbose. |
With my vote, this makes the majority of the team. Sorry @quaff but the reference docs are not meant to track design decisions and tradeoffs but rather describe how things work. |
@philwebb How about this proposal? The current behavior is counter-intuitive, there are several issues that reporter is confused by EDIT: I created prototype https://github.com/spring-projects/spring-boot/compare/main...quaff:spring-boot:patch-87?expand=1 |
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
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
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
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
spring-boot/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/external-config.adoc
Lines 914 to 915 in 50d0519
It would be nice if more words here to show the motivation.
The text was updated successfully, but these errors were encountered: