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
Removing the cast will resolve the issue. But I don't know this issue exists due to non compatibility with OpenAPI 3.1 or if it's a mere programming error.
The intended annotation use is: @ApiResponse(responseCode = "200", description = "Get a foorter", content = @Content(schema = @Schema(anyOf = { Footer.class, Footer2.class }) Object getFooter();
The cast to ComposedSchema here:
https://github.com/swagger-api/swagger-core/blob/95c8253c5239f6e980acd0b2998d037b35eb8761/modules/swagger-core/src/main/
java/io/swagger/v3/core/util/AnnotationsUtils.java#L827
https://github.com/swagger-api/swagger-core/blob/95c8253c5239f6e980acd0b2998d037b35eb8761/modules/swagger-core/src/main/
java/io/swagger/v3/core/util/AnnotationsUtils.java#L834
https://github.com/swagger-api/swagger-core/blob/95c8253c5239f6e980acd0b2998d037b35eb8761/modules/swagger-core/src/main/
java/io/swagger/v3/core/util/AnnotationsUtils.java#L841
Will cause a ClassCastException when generating OpenAPI 3.1
ComposedSchema is only created when OpenAPI is not 3.1.
See:
swagger-core/modules/swagger-core/src/main/java/io/swagger/v3/core/util/AnnotationsUtils.java
Line 605 in 95c8253
Removing the cast will resolve the issue. But I don't know this issue exists due to non compatibility with OpenAPI 3.1 or if it's a mere programming error.
The intended annotation use is:
@ApiResponse(responseCode = "200", description = "Get a foorter", content = @Content(schema = @Schema(anyOf = { Footer.class, Footer2.class }) Object getFooter();
Maybe this issue is related to #4634
The text was updated successfully, but these errors were encountered: