Skip to content

Make @ConditionalOnProperty and @ConditionalOnBooleanProperty @Repeatable #2541

Closed
@chrylis

Description

@chrylis

I have a class that requires a couple of configuration properties to be set in order to instantiate a service, and also an enabled flag to turn off that autoconfig. While I'd like a simpler setup (#2312), in the meantime I'm trying to use @ConditionalOnProperty to check whether the properties are available. Since enabled defaults to true, I want it to matchIfMissing, but obviously not the other actual configuration properties.

However, matchIfMissing (and havingValue) apply to all of the properties in the annotation. I would like to be able to repeat the annotation to specify multiple property names that have different presence/value matching parameters.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions