Multiple OpenAPI definitions in one Spring Boot project
See original GitHub issueI am trying to describe two different versions (v1 and v2) with Open API. Basically Swagger UI I should display v1 from http://localhost:8080/v3/api-docs
and v2 from http://localhost:8080/v3/api-docs/v2
.
With the springfox Swagger Config I could do this through Docket
s. Then I had the selection where I could switch the different endpoint definitions.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:17 (2 by maintainers)
Top Results From Across the Web
Springdoc with multiple api-docs - Stack Overflow
I want to group three API docs in one swagger-ui. I use Springdoc. Each of the three API-docs has its own url. (They...
Read more >OpenAPI 3 Library for spring-boot
OpenAPI 3 Library for spring boot projects. Is based on swagger-ui, to display the OpenAPI description.Generates automatically the OpenAPI ...
Read more >Creating OpenAPI definitions for APIs using springdoc - Medium
First thing's first; for this example I am using a Java based API back end server code, maven for dependency management in a...
Read more >Doing More With Springdoc-OpenAPI - DZone
In my last recent article we tried out a Spring Boot Open API 3-enabled REST project and explored some of its capabilities namely:....
Read more >'Code First' API Documentation with Springdoc and Spring Boot
We define it in the application.yml of our Spring Boot project: springdoc: api-docs: path: /reflectoring-openapi. Springdoc will now add the endpoint ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This feature will be available on the next release: v1.2.19 of springdoc-openapi.
You can define your own groups of API based on the combination of: API paths and packages to scan. Each group should have a unique groupName. The OpenAPI description of this group, will be available by default on:
To enable this feature, the following springdoc property needs to be added to your application.yml:
For the support of multiple OpenAPI definitions, a bean of type GroupedOpenApi needs to be defined.
For the following Group definition(based on package path), the OpenAPI description url will be : /v3/api-docs/stores
For the following Group definition (based on package name), the OpenAPI description url will be: /v3/api-docs/users
For the following Group definition(based on path), the OpenAPI description url will be: /v3/api-docs/pets
For the following Group definition (based on package name and path), the OpenAPI description url will be: /v3/api-docs/groups
For more details about the usage, you can have a look at the following sample Test:
@springdoc please don’t close the issue right away, because even if you don’t allow multiple OpenAI definitions, there is still the question on how to document different versions. Like Springfox Swagger Config allowed with Docket. So can you please tell me if that is possible or not. And if it is possible on how to achieve that. Because I went through the documentation and I only found one way to document all different versions (in our case v1, v2 and internal).