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
but then the generated openapi.yaml will be missing top-level type: object fields in the component schemas because the generator calls schema.type("object") instead of schema.types(Set.of("object")) and skips OpenAPI31SpecFilter/OpenAPISchema2JsonSchema.
The text was updated successfully, but these errors were encountered:
@shawnsmith
Fixed by: #4729
Just to mention, the openapi31 flag is the best and correct way to resolve into an OpenAPI 3.1 specification, as it understands 3.1 annotations and correctly uses 3.1 model. convertToOpenAPI31 is an early option to get out a 3.1 doc, still usable but less "powerful"
I would suggest to use openapi31 flag, as issue with missing type: object is already fixed also
I am closing this ticket for now, if there will be still any issues, feel free to reopen
If you configure the
swagger-maven-plugin
as follows:Then the generated
openapi.yaml
will contain the following due to https://github.com/swagger-api/swagger-core/blob/v2.2.22/modules/swagger-core/src/main/java/io/swagger/v3/core/util/OpenAPI30To31.java#L13:Unfortunately this causes the Swagger UI to display an unfriendly warning due to swagger-api/swagger-ui#8491. The UI expects this instead:
One possible workaround would be to use the
openapi31
config setting instead, which skips settingjsonSchemaDialect
:but then the generated
openapi.yaml
will be missing top-leveltype: object
fields in the component schemas because the generator callsschema.type("object")
instead ofschema.types(Set.of("object"))
and skipsOpenAPI31SpecFilter
/OpenAPISchema2JsonSchema
.The text was updated successfully, but these errors were encountered: