You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make it possible to use swagger-annotations separately through springdoc-openapi dependency #2044
Is your feature request related to a problem? Please describe.
We have multi modulw project. Let's say back, front and lib (back and front dependes on lib). And we have some class in lib that is useb by both back and front and is part of swagger public API. So we wanna put swagger annotations on that class. But we don't want all springdoc-openapi dependency in back module. And we don't want to use specific swagger-annotations depdendency to prevent collisions in case of springdoc upgrade.
So we would like to have single dependency for both springdoc-openapi-ui and swagger-annotations. Or at least to have two dependencies with the same version.
Describe the solution you'd like
Currently springdoc-openapi has dependency on io.swagger.core.v3:swagger-core. If you add io.swagger.core.v3:swagger-annotations dependency into springdoc-openapi pom then it will be possible to use springdoc-openapi as a bom to import both springdoc-openapi-ui and swagger-annotations. And then do it like that:
lib pom.xml:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi</artifactId>
<version>_springdoc.version.here_</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
</dependencies>
front pom.xml:
use lib as parent or import springdoc-openapi-bom other way
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
</dependency>
Describe alternatives you've considered
As an alternative it is possible to use the following dependency directly for springdoc-openapi 1.6.11:
Please note: on springdoc-openapi upgrade you have to remember to go to springdoc-openapi, find swagger-api version there and then to update swagger-annotations dependency.
This used to be the case. In v1.6.3 swagger-annotations was in the classpath. It appears to have been removed in v1.6.4 in #1424 - was this intentional?
Activity
dominic-jones commentedon Jan 20, 2023
This used to be the case. In v1.6.3 swagger-annotations was in the classpath. It appears to have been removed in v1.6.4 in #1424 - was this intentional?
bnasslahsen commentedon Feb 5, 2023
@dominic-jones and @mpashka,
The
swagger-coredependency includesswagger-annotations.You should not declare any
swagger-xxxdependencies while usingspringdoc-openapi