Is there any elegant way to specify dependency version should be the same as one used by another dependency?
We use springdoc-openapi ( GitHub - springdoc/springdoc-openapi: Library for OpenAPI 3 with spring-boot ) and have defined the following in our libs.version.toml:
[libraries]
springdoc-openapi-bom = { module = "org.springdoc:springdoc-openapi-bom", version = "2.8.15" }
springdoc-openapi-starter = { module = "org.springdoc:springdoc-openapi-starter-webmvc-api" }
Unfortunately, their BOM does not define the version of Swagger they are using.
I have requested that (see: Add swagger version to BOM · Issue #3212 · springdoc/springdoc-openapi · GitHub ), but until/if that becomes available, we would like a workaround.
We need to use the following swagger dependencies to be able to use the annotations and to configure PrimitiveTypes for the documentation generation:
io.swagger.core.v3:swagger-annotations-jakarta
io.swagger.core.v3:swagger-core-jakarta
Can we write some Gradle magic that defines the version of the swagger dependencies to be the same used by springdoc-openapi-starter?