springdoc / springdoc-openapi

Library for OpenAPI 3 with spring-boot
https://springdoc.org
Apache License 2.0
3.26k stars 493 forks source link

annotation for groups #2697

Closed zdary closed 1 week ago

zdary commented 1 month ago

Is your feature request related to a problem? Please describe. We'd like to have various separate json openapi export options to give to different integrators of our api.

We need the following:

The main goal is to export the openapi json for different customers, and allow post-processing such as readme.io.

What is the actual result using OpenAPI Description (yml or json)?

We are fine with either yml or json but each group should have its own json.

Describe the solution you'd like

apart from groupConfig.pathsToMatch and groupConfig.packagesToScan we would like to have annotation based approach on to of this mechanism.

i.e. annotate any method or controller with @SwaggerGroup("group1") and this annotation will take precedence over the pathsToMatch or packagesToScan configuration.

Describe alternatives you've considered We considered to go with groupConfig.pathsToMatch and groupConfig.packagesToScan only. But this forces our application to use url or package layout we would normally didn't use.

note we are currently on spring 2.x and use 1.8.0 library version.

bnasslahsen commented 1 week ago

@zdary,

We have no plans for this ER. Feel free to propose a PR, if you feel it useful for the community.