Description
Describe the bug
Since @JsonUnwrapped
has been broken in 2.6.0 I still not able to make @JsonUnwrapped
work with my Kotlin data classes despite numerous fixes:
- 2.6.0 of springdoc-openapi-starter-webmvc-ui seems to introduce a regression when using @JsonUnwrapped & @Delegate #2682
- @JsonUnwrapped is ignored in new version of lib #2856
To Reproduce
data class ContactCreateRequest(
@JsonUnwrapped
val person: Person,
@Schema(required = false)
@JsonProperty("labels", required = false)
val labels: List<String>? = null,
)
data class Person(
@Schema(required = true, example = "Oscar Claude Monet")
@JsonProperty("name", required = true)
val name: String,
@Schema(example = "+38051231412")
@JsonProperty("phone")
val phone: String? = null,
@Schema(required = true, example = "oscar.monet@lafrance.fr")
@JsonProperty(value = "email", required = true)
val email: String,
)
This example in a sample Spring Boot project:
Dependencies
- Kotlin 2.1.10
org.springdoc:springdoc-openapi-starter-webmvc-api:2.8.4
org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.4
org.springframework.boot:spring-boot-....:3.4.2