matrei commented on code in PR #16798:
URL: https://github.com/apache/grails-core/pull/16798#discussion_r4431824051


##########
grails-doc/src/en/guide/conf/config/ymlPropertyOptions.adoc:
##########
@@ -34,6 +34,20 @@ production:
 
 Similarly system arguments can be accessed.
 
+A placeholder is resolved wherever it appears in a value, including in an 
element of a list or in a map inside one:
+
+[source,yaml]
+----
+app:
+    origins:
+        - https://app.example.com
+        - '${EXTRA_ORIGIN:https://admin.example.com}'
+----
+
+`grailsApplication.config` gives the resolved element whether the list is read 
whole, with `config.getProperty('app.origins', List)`, or by index, with 
`config.getProperty('app.origins[1]')`, as Spring's `Environment` does.

Review Comment:
   Correction to the docs comments: the binder case is already tracked as 
#16550. Grails 8 fixes it in #16552, with #16795 as a follow-up, by presenting 
lists only under their indexed names. That's listed as a breaking change in the 
8.0 upgrade notes, so I don't expect it to come to 7.0.x, and there's nothing 
new to open.
   
   Limiting the docs to `grailsApplication.config` still applies on 7.0.x. The 
NOTE, though, should be dropped when this is merged up to 8.0.x, where binding 
resolves list elements. Could you add that to "Merging up"? On 7.0.x the NOTE 
could also give the workaround from #16550:
   
   ```suggestion
   NOTE: A list bound with `@ConfigurationProperties`, such as 
`grails.cors.allowedOrigins`, still receives the placeholder as written when 
`application.yml` is read through Grails' YAML loader. Write such a list as one 
comma-separated value, 
`'https://app.example.com,${EXTRA_ORIGIN:https://admin.example.com}'`, and the 
placeholder is resolved when the list is bound.
   ```



-- 
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