-
Notifications
You must be signed in to change notification settings - Fork 41k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make @ConditionalOnProperty and @ConditionalOnBooleanProperty @Repeatable #2541
Comments
Have you seen |
In this case, I'd need an |
Ahh OK. Good point. We do have a PR for that but it won't be looked at until 1.3 (see #2400). I like the repeatable idea as well. |
Should this be a logical OR or an AND? |
@benneq My take is that it should be a logical |
It would be nice if this feature would come soon. It is much more easier to use multiple |
+1 |
vote vote +1 |
obviously +1 |
This requires a core framework change that still needs to be discussed. I've raised SPR-17207. |
+1 |
We may be able to do this without needing the Framework change. |
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. Sinceenabled
defaults totrue
, I want it tomatchIfMissing
, but obviously not the other actual configuration properties.However,
matchIfMissing
(andhavingValue
) 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.The text was updated successfully, but these errors were encountered: