Given:
my:
map:
"/key": "value"
Before this commit: It's equivalent to
my:
map:
"[key]": "value" # "[/key]" is expected
Such counter-intuitive behavior will confuse developers, there are several reported issues, incomplete list: GH-41099 GH-29582 GH-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 GH-42802
Comment From: philwebb
Thanks @quaff. I read your comment on the other issue but didn't have a chance to reply due to last minute work for the release. We'll discuss this one when we can.
Comment From: philwebb
Thanks for the PR @quaff. I agree that it would be nice to fix this, but I don't think we should put so much YAML knowledge into the MapBinder. I think we probably need to do something with ConfigurationPropertyName and possibly add a failure analyzer. I'm not too sure on the design details yet, that will have to be something we look at after 3.4 is out of the door.
Comment From: philwebb
I've opened #42984 so we don't forget about the issue.
Comment From: quaff
but I don't think we should put so much YAML knowledge into the
MapBinder
Just for friendly error message, it doesn't couple YAML and MapBinder.