Skip to content

Document when environment variable property mapping applies #41877

@michaelmcfadyensky

Description

@michaelmcfadyensky

I have recently created a custom EnvironmentPostProcessor that added a new property source into the Environment. The property source I added was a SystemEnvironmentPropertySource. Everything was seemingly working as expected but some of the relaxed binding rules (described here) weren't being applied as expected.

After much debugging and searching I came across this stackoverflow answer that explains that to ensure the environment variable relaxed binding rules are applied correctly to custom property sources, the property source name has to end with "-systemEnvironment". I assumed (wrongly) that the binding rules would be determined by the property source type, not an arbitrary suffix on the name.

I did some further digging and could not finding any documentation explaining this. Could we add something into the docs to explain this specific use case?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions