codeconsole opened a new pull request, #16772:
URL: https://github.com/apache/grails-core/pull/16772

   `toProperties()` and `toFlatConfig()` exported each entry of a map written 
by map subscripts twice, under its bracketed flat key and under the dotted name 
the walk of the map gives it:
   
   ```groovy
   // application.yml: app.routes: { '[/api/**]': x, '[/v1.0/**]': y }
   config.toProperties().stringPropertyNames().findAll { 
it.startsWith('app.routes') }
   // was [app.routes[/api/**], app.routes./api/**, app.routes[/v1.0/**], 
app.routes./v1.0/**]
   // now [app.routes[/api/**], app.routes[/v1.0/**]]
   ```
   
   Spring Boot binds the dotted names with their special characters removed, so 
a map bound from the export, as `doWithConfig` publishes it in a test or a 
plugin binds it, held keys such as `api` and `v10` beside `/api/**` and 
`/v1.0/**`. Each entry is now exported once, by its bracketed key; a map put as 
a value, which has no bracketed flat keys, is still exported by the dotted 
names of its entries. `PropertySourcesConfigSpec` checks the exported names and 
binds the export with Spring Boot's `Binder`.
   
   Found while working on #16732; the bug is the same on every branch from 
7.0.x to 9.0.x.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to