Description
- using springdoc-openapi-javadoc 1.6.9
- the controller contains a parameter or return type of type Foo
- Foo contains a field of type Bar which is annotated with @JsonUnwrapped
- the javadoc of the fields of Bar is not set to the output description
To Reproduce
download and unzip the sample project
demo-springdoc-javadoc.zip
run with
mvn spring-boot:run
open
http://localhost:8080/swagger-ui/index.html
select Schema
Expected behavior
the javadoc of the Bar field should be set in the api-docs and hence will be displayed by swagger-ui
Screenshots
This is how it looks like
This is how it should be (generated with the proposed solution)
Solution proposal
in org.springdoc.openapi.javadoc.JavadocPropertyCustomizer.setJavadocDescription(Class<?>, List, Schema)
the method should be called recursively for all types of fields annotated with @JsonUnwrapped
fields.stream().filter(f -> f.isAnnotationPresent(JsonUnwrapped.class)) .forEach(f -> setJavadocDescription(f.getType(), FieldUtils.getAllFieldsList(f.getType()), existingSchema));