-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION][JAVA] Is support for swagger UI 3.0 present? #8703
Comments
I'm facing the same issue here. I've tried several solutions in order to display the swagger-ui according to OAS 3 model. I tried to switch from springfox 2.9.2 to springdoc and also tried to upgrade springfox to version 3.0.0 but none of my atempts worked. Seems that the generated code still depends on springfox 2.x classes like RelativePathProvider. Is there any workaround to generate the OAS 3 documentation? |
I am also facing same issue . When I have updated to swagger version 3, spring generator is generating OpenAPIDocumentationConfig with swagger 2 annotation and it is also using class RelativePathProvider in imports which is removed in version 3 of swagger. Any solution to resolve this? |
Is there any fix available for this problem yet? |
This topic is still relevant and occurs in current version: openapi-generator-maven-plugin: 5.2.1 The class |
Technically the version of the Swagger UI with those annotations is 3.17.1 which is Swagger UI 3.0. You can check by generating the swagger definitions and running your application with them, then typing in the browser console:
You will see:
So this is inconsistency is misleading springfox 3.0+ does not mean swagger UI version 3.0+. Check out this: https://swagger.io/docs/open-source-tools/swagger-ui/usage/version-detection/ |
Does anyone have any working solution for this issue? I am using Springboot 2.5.6 and OpenApi Generator 5.3.0 |
Hey, we are using: <plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.3.0</version>
</plugin> springfox dependency: <dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency> |
Same problem as reported by @DamasFoux Best, Mike |
It is passing with openapitools version 6.0.0 |
Description
Hello, I noticed that when I generate the code the generated Swagger UI Configuration class in
OpenAPIDocumentationConfig.java
has annotation@EnableSwagger2
. And at the same time I couldn't find how to remove this annotation since springfox which works with swagger 3.0 requires this annotation to be removed.My question is swagger UI 3.0 supported, is there a configuration to switch this as the generator also generates the UI (please correct me if I am wrong) along with the clients for the API?
openapi-generator version
5.0.1
OpenAPI declaration file content or url
Its valid I just want the generated UI to be swagger 3.0 and not swagger 2.0
Command line used for generation
java -jar $SCRIPTDIR/openapi-generator-cli.jar generate --generator-name spring --config $SCRIPTDIR/config-spring.json --output ./model -i ./api.yaml
Steps to reproduce
N/A
Related issues/PRs
#5803
#6108
Suggest a fix/enhancement
Not really familiar with the codebase of this project so I was not able to find how the
OpenAPIDocumentationConfig.java
is generated. But I suppose if a flag is added with the swagger ui version to the cli the file can be generated properly as perhttps://github.com/springfox/springfox/blob/master/README.md#spring-boot-applications
The text was updated successfully, but these errors were encountered: