Affects: 2.6.7
Currently Spring allows registering immutable classes or records as @ConfigurationProperties via @ConstructorBinding only using @EnableConfigurationProperties or @ConfigurationPropertiesScan. Just creating configuration classes as regular beans is impossible.
However immutable classes / records are obvious natural fit for applications which context is constructed using functional bean registration. However as things stand now one cannot register configuration record using functional bean registration mechanism.
Please enable this option in order to extend feasibility of writing immutable / functional applications using Spring.
Comment From: philwebb
I think you might be able to get close to what you want to do by using the Binder directly. This won't look at the @ConfigurationProperties annotation so you'll need to specify a name attribute. Something like this:
Binder.get(environment).bindOrCreate("my.thing", MyThing.class);
Comment From: philwebb
We may require an API like this if we start to AOT process @ConfigurationProperties and generate code. I suspect this isn't something we'll be able to do for 3.0.0 so I'll put this one in the 3.x bucket for now.
Comment From: hajdamak
@philwebb Thanks. This is exactly what I need. There is no need for @ConfigurationProperties, it is even better to pass it in function parameter.
Comment From: philwebb
Great, I'm going to close this one for now but we might re-open it if we need a new API for the Graal work.