codeconsole commented on code in PR #16732:
URL: https://github.com/apache/grails-core/pull/16732#discussion_r4417798614
##########
grails-doc/src/en/guide/upgrading/upgrading90x.adoc:
##########
@@ -1241,3 +1241,36 @@ Grails no longer registers a character encoding filter
of its own. It used to, a
* `spring.servlet.encoding.enabled: false` turns the encoding filter off.
* The CAS plugin's single sign-out filter, which reads a parameter of every
POST, is registered right after the encoding filter.
* A filter of your own that reads request parameters needs a later order than
`Ordered.HIGHEST_PRECEDENCE`, or form input reaches controllers decoded as
ISO-8859-1. One registered at exactly `Ordered.HIGHEST_PRECEDENCE` through a
`FilterRegistrationBean` runs before the encoding filter.
+
+==== 21. A Configuration Key Below a Value That Is Not a Map Is Absent
+
+In Grails 8, `getProperty` on `grailsApplication.config` answered a dotted key
that runs past a value that is not a map with that value: `server.url.port`
when `server.url` is a string, `server.ports.0` when `server.ports` is a list,
or `grails.gorm.default.constraints.nullable` when
`grails.gorm.default.constraints` is a closure from `application.groovy`.
`containsProperty` of such a key was `true`. In Grails 9 the key is absent:
`getProperty` returns `null` or the default, `containsProperty` returns
`false`, and `navigate` answers `null`.
+
+Below a list, a whole-number segment names an element instead, as Spring Boot
reads it, and so does an index after the name of the list, whether the list
comes from `application.yml` or from `application.groovy`:
Review Comment:
Added in dc9924d334, in §21 and in the `grails-9-upgrade` skill. A
placeholder in a list element is not resolved by `config`, by index or in the
whole list, as in Grails 8. The `Environment` resolves it, so the text says to
read such an element there or to bind the list with `@ConfigurationProperties`.
I reproduced it with Grails' YAML loader at the new head. `app.origins.1`,
`app.origins[1]` and the elements of `getProperty('app.origins', List)` all
come back as `${EXAMPLE_ORIGIN:…}`. So does a value in a map inside a list,
`app.rows.0.url`. The `Environment` answers `https://default.example.com` for
each. Spring Boot's YAML loader is not affected, because
`PropertySourcesConfig` resolves each element of a list it reads from a source
that is not a `NavigableMapPropertySource`.
The hook fix is #16798, against 7.0.x, where the hook and the loader are the
same as on 9.0.x. It resolves the strings in a list, through the maps and lists
inside it, and a value or map written under an indexed key, so the config
answers each of the reads above as the `Environment` does. Its description says
to drop this sentence when it reaches 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]