With new Spring Boot 2.2 you can do like so:
@ConstructorBinding
@ConfigurationProperties(prefix = "swagger")
data class SwaggerProp(
val title: String, val description: String, val version: String
)
And don’t forget to include this in your dependencies in build.gradle.kts:
dependencies {
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
}