Edit: Just upgrade to Spring Boot 2.5.1 where this is resolved.
Old answer below:
I managed to fix this for now by adding exclusions to my spring-boot-starter-security dependency which apparently defined this Kotlin dependency.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<exclusions>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</exclusion>
</exclusions>
</dependency>
Answer from Sebastiaan van den Broek on Stack OverflowEdit: Just upgrade to Spring Boot 2.5.1 where this is resolved.
Old answer below:
I managed to fix this for now by adding exclusions to my spring-boot-starter-security dependency which apparently defined this Kotlin dependency.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<exclusions>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</exclusion>
</exclusions>
</dependency>
There seems to be a solution here. The idea is to provide extra configuration for Jackson2ObjectMapperBuilderCustomizer. Sucks that a code change is required but there you have it.
Add @RequestBody to your controller method as
@PostMapping("/login")
fun login (@RequestBody req : AuthorizationRequest): String {
return "received auth request: ${req.username}"
}
Response is:

Can you try this? Since a few Kotlin versions I got the warning that you have to decide where you want to put the annotation on: constructor parameter or the field itself.
data class AuthenticationRequest(
@param:JsonProperty
val username : String,
@param:JsonProperty
val password : String
)
// alternative
data class AuthenticationRequest(
@field:JsonProperty
val username : String,
@field:JsonProperty
val password : String
)