When running the Spring Boot application with org.springdoc:springdoc-openapi-webflux-ui:1.7.0
when using nested complex types as properties, the generated schemas represent separate types as well as whole classes, for example:
@RestController
class Controller {
@GetMapping
fun getA(): A {
return A(A.B(name = "Tom"))
}
}
data class A(val b: B) {
data class B(val name: String)
}
will result in generating in OpenAPI definition:
- the schema for class B
- the schema for class A consisting class B
I wonder if there is any way in Spring Boot either on the configuration level through properties file or specific bean registration to restrict it to only having high-level schemas generated?