- Notifications
You must be signed in to change notification settings - Fork 41.7k
Closed
Labels
theme: config-dataIssues related to the configuration themeIssues related to the configuration themetype: enhancementA general enhancementA general enhancement
Milestone
Description
Currently, it seems we are forced to use Kotlin classes with mutable nullable properties and default constructor with @ConfigurationProperties while idiomatic Kotlin code would be using classes with immutable properties initialized via constructor. I think there is a way to supporting that by leveraging kotlin-reflect library like jackson-module-kotlin do.
More concretely, in MiXiT app I would like to be able to convert this MixitProperties class implementation to:
@ConfigurationProperties("mixit") class MixitProperties( val baseUri: String, val admin: Credential, val drive: Drive ) class Credential( val username: String, val password: String ) class Drive( val fr: DriveDocuments, val en: DriveDocuments ) class DriveDocuments( val sponsorform: String, val sponsor: String, val speaker: String, val press: String ) We could imagine to support optional properties by using nullable types, like val sponsorform: String? for example.
I will be happy to help. I have also already worked with @apatrida who maintains Jackson Kotlin module, he may provide us some guidance I think.
daniellavoie, sbuettner, alexluix, cleiter, kitsjingkeily and 134 more
Metadata
Metadata
Labels
theme: config-dataIssues related to the configuration themeIssues related to the configuration themetype: enhancementA general enhancementA general enhancement