Skip to content

Fallback with placeholder is evaluated even if the fallback is not required #26268

Closed
@FrancoCorleone

Description

@FrancoCorleone

Hello all,
used spring boot: 2.2.1.RELEASE
Problem: When defining application.yml properties I want to use something like:
property: ${FOO:someFallbackWithEnv_${BAR}}

someOtherProperty: ${property}

With @ConfigurationProperties it works as expected but with injection via @Value or in application.yml (someOtherProperty) it fails with "could not resolve BAR". I think it is not expected as FOO was defined as env variable so the other part should not be processed at all IMO.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions