4
votes

We are trying upgrade SPringFox2.0 to 3.0 Open API Specification. But when we generate open doc using '' url it is showing version as 2.0. Not sure why the version still pointing to old version.

We are using Springboot application

I followed the below steps to upgrade as per spring fox documentation

[http://springfox.github.io/springfox/docs/current/][1]

"2.1.3. Migrating from existing 2.x version"

Spring Boot Applications

1.Remove library inclusions of earlier releases. Specifically remove springfox-swagger2 and springfox-swagger-ui inclusions.

2.Remove the @EnableSwagger2 annotations

3.Add the springfox-boot-starter

4.Springfox 3.x removes dependencies on guava and other 3rd party libraries (not zero dep yet! depends on spring plugin and open api libraries for annotations and models) so if you used guava predicates/functions those will need to transition to java 8 function interfaces

I followed all the steps above, 'http://localhost:XXXX/api/v1/api-docs?group=API_Version_1' it got generated but version is showing 2.0 {"swagger":"2.0","info":{ ........

And also I modified in SwaggerConfig: DocumentationType.SWAGGER_2 TO DocumentationType.OAS_30 (it is not mentioned documentation, I guess they missed it)

I believe still some thing is missing, Spring Fox documentation is still out of date and poor coverage of 3.0 aspects.

I am wondering any one having same problem?

2
Did you get it working? We are doing the same thing and I followed the steps but it did not work either.toosensitive

2 Answers

2
votes

Try to use /v3/api-docs or /api/v3/api-docs in your case.

0
votes

That did not work. As per Spring fox documentation: "The /v2/api-docs URL is the default that SpringFox uses for documentation. The v2 does not refer to your API's documentation version (which can be changed in the Docket configuration), but the version of the Swagger specification being used..."

springfox.documentation.swagger.v2.path=/my/docs (path of yours)