This chapter https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config.typesafe-configuration-properties.relaxed-binding.environment-variables of the doc states that Remove any dashes (-). but that is not true (and it is a good thing). The dashes or replaced by underscores.
Example at the end of that chapter should also be updated: https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config.typesafe-configuration-properties.relaxed-binding
See here : https://github.com/spring-projects/spring-framework/blob/main/spring-core/src/main/java/org/springframework/core/env/SystemEnvironmentPropertySource.java#L133 and : https://github.com/spring-projects/spring-framework/issues/18172
Comment From: wilkinsona
This is intentional. While the extra separators are tolerated they are not recommended and, therefore, the support for them is deliberately not documented. See https://github.com/spring-projects/spring-boot/issues/10873.