You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see the type of the items in the array is set to string which looks wrong and also results in swagger-ui rendering the API wrong.
Tracking the code led me to this line which sets the type to "string":
I don't really understand why this is done. As a workaround to get it working correctly I added an explicit type to the items like this which atleast makes swagger-ui render the anyOf correctly:
Hi!
I am using Spring Boot (3.2.3) with springdoc-openapi-starter-webmvc-ui (2.2.20). I have a controller annotated like this:
This results in an API specification looking like this:
As you can see the type of the items in the array is set to string which looks wrong and also results in swagger-ui rendering the API wrong.
Tracking the code led me to this line which sets the type to "string":
swagger-core/modules/swagger-core/src/main/java/io/swagger/v3/core/util/AnnotationsUtils.java
Line 1745 in 3fcc473
I don't really understand why this is done. As a workaround to get it working correctly I added an explicit type to the items like this which atleast makes swagger-ui render the anyOf correctly:
What I would have expected in the first place is that the type is not added to the items at all if an anyOf is included.
The text was updated successfully, but these errors were encountered: