Hi all, I noticed that by default, the Spring anno...
# spring
d
Hi all, I noticed that by default, the Spring annotation @ConfigurationProperties is not added to the list of all-open annotations (which I think is here: https://github.com/JetBrains/kotlin/blob/cca2680c7f1c3e690a9f4a56f13449f20ebfaa6d/plugins/allopen/allopen-cli/src/AllOpenPlugin.kt), would it be useful to add it? We've had some issues with it and adding it manually to our all-open had solved it:
<option>all-open:annotation=org.springframework.boot.context.properties.ConfigurationProperties</option>
You could 'force' it to be opened by adding
@Component
, but that turns it into a regular bean which may not be what you want
Also, in the Spring docs it has some examples where
@ConfigurationProperties
annotated classes are turned into bean by other methods than turning it into a regular bean: https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config.typesafe-[…]roperties.enabling-annotated-types
k
what was the issue?
d
The issue was/is that a data class annotated with
@ConfigurationProperties
is not automatically opened by the
spring
compiler plugin, thus Spring Boot can not deal with it properly. So you either have to add that annotation to the all-open plugin or make it a non-data class
k
thus Spring Boot can not deal with it properly
this is what I am curious about
d
I think Spring always requires something which it turns into a Bean to not be final?
e
We use @ConfigurationProperties and we dont use all open. I think there might be something wrong with your setup, maybe?
also yes 1
d
Hmm, do you annotate it with something else like @Component?
Is it a data class or a regular class?
e
Data class. No other annotations. We add @ConfigurationPropertiesScan on our Spring Application. Confirm that you also have that added