Open pbarnes-tibco opened 2 years ago
Seems same behaviour as in #12690
Hi @pbarnes-tibco , I'm not sure if you saw in the generated java class, but you also have the following issue:
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success", response = Void.class),
@ApiResponse(code = 200, message = "unexpected error", response = Error.class)
})
Basically, because you added "default" response type, you get this duplication for response "200". I'm facing the same issue and this leads to incorrect showing on the swagger ui. Do you guys know how to fix this?
Hi @pbarnes-tibco , I'm not sure if you saw in the generated java class, but you also have the following issue:
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class), @ApiResponse(code = 200, message = "unexpected error", response = Error.class) })
Basically, because you added "default" response type, you get this duplication for response "200". I'm facing the same issue and this leads to incorrect showing on the swagger ui. Do you guys know how to fix this?
I had not noticed that, and have not looked into it; not sure how to fix.
I had not noticed that, and have not looked into it; not sure how to fix.
I actually checked everywhere and it turns out it's actually a bug and I corrected it in a PR at https://github.com/OpenAPITools/openapi-generator/pull/13021. For my use case, it was enough to generate (mvn clean install
) the jar's on my machine and use this patched version.
Maybe you can also look into your issue.
Description
I have a derived/subclass model generated using allOf, which is used in a path param in an API. The jaxrs-spec generator in v6.0.0 is generating the API class without an import for the derived class. It contains an import for the superclass instead. It will not compile.
In this case the subclass contains no members of its own, but the problem also occurs if it does have additional members.
openapi-generator version
6.0.0. Works in 5.4.0.
OpenAPI declaration file content
Generation Details
Command line:
Steps to reproduce
Base
but notDerived
.Derived
is correctly generated as a path param for thegeneratorBug
operation, but without the proper import, will not compile.The generated api class:
Related issues/PRs
Found none.
Suggest a fix
The generator should generate the class with the proper import, as in v 5.4.0.