Having first asked on Stackoverflow and not received any response in several days, opening a bug report.

Spring Boot supports Kotlin data classes for @ConfigurationProperties.

@ConstructorBinding
@ConfigurationProperties(prefix = "prefix")
data class AppProperties (
    val something: String
)

But val and @ConstructorBinding has some limitations. You cannot alias one variable to another. Let's say you're running in Kubernetes and want to capture the hostname, which is given by the env var HOSTNAME. The easiest way to do this is to apply @Value("\${HOSTNAME}:)" to a property, but it only works for a mutable property and without constructor binding.

Comment From: wilkinsona

I've answered this on Stack Overflow.

@asarkar Please bear in mind our code of conduct when asking Spring Boot questions on Stack Overflow. It is intended to ensure that the Spring Boot community is as friendly and welcoming as possible. Marcos Barbero was taking the time to try and help you and I don't think the tone of your responses to him was warranted.

Comment From: asarkar

Thanks for your response. As for Marcos on SO, he claimed that my code was a “misuse”, but failed to furnish supporting logic or reasoning in spite of being asked. Thus, there was no reason to accept anything he said from that point on. “It’s wrong because I say so” isn’t exactly a very convincing technical argument.