Open
Description
Functional bean registration does not presently provide equivalents for @ConfigurationProperties
, @EnableConfigurationProperties
.
It would be great to remove all the annotation-indirection and allow users to directly create beans based off of configuration.
For example:
beans {
configurationPropertiesBean<SomeBean>(prefix = "my.prefix")
}
Where a minimal implementation of configurationPropertiesBean
could look like:
public inline fun <reified T : Any> BeanDefinitionDsl.configurationPropertiesBean(prefix: String) {
bean {
Binder.get(env)
.bindOrCreate(prefix, Bindable.of(T::class.java))
}
}
This provides capabilities for registering multiple configuration properties beans of the same type, from different prefixes, and/or determining those prefixes dynamically.