Skip to content

Environment variable that does not follow guidelines for use of _ is still successfully bound if another property source contains a property that is bound to the same target #14479

Closed
@Bert-R

Description

@Bert-R

We have custom properties, built like this:

@ConfigurationProperties("yona")
@Configuration
public class YonaProperties
{
	@NestedConfigurationProperty
	private final AnalysisServiceProperties analysisService = new AnalysisServiceProperties();

Properties would be set on AnalysisServiceProperties in this way:

yona.analysisService.someProperty=someValue

Or through an environment variable, like this:

YONA_ANALYSIS_SERVICE_SOME_PROPERTY=someValue

With Spring Boot 1.5, it was OK to not have any yona.analysisService.xxx property in application.properties and still set one through an environment variable like YONA_ANALYSIS_SERVICE_XXX.

With Spring Boot 2.0.4, that doesn't work anymore. At least one yona.analysisService.xxx must exist in application.properties. It's OK to set xxx in application.properties and yyy through the environment, but there needs to be at least one.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions