3

I have a requirement to support swagger 2 & 3 in my spring boot API.

I have created swagger 2 using docket object & for swagger 3 just added maven dependency springdoc-openapi-ui. Able to check swagger 2 & 3 documentation.

how do I disable/enable only swagger 3 or swagger 2? I mean how do I disable swagger 3 configurations?

I don't have swagger 3 configuration class to enable/disable by using @profile. Just adding springdoc-openapi-ui maven dependency swagger 3 worked.

Thilo Schwarz
  • 640
  • 5
  • 24
Ashwin Patil
  • 1,307
  • 1
  • 23
  • 27

1 Answers1

12

Here's the answer copied from this comment

The following property is available since: v1.1.16

springdoc.api-docs.enabled=false This property helps you disable springdoc-openapi endpoints.

If you want to expose the api-docs endpoints without using the swagger-ui, you can use the core dependency:

<dependency>
    <groupId>org.springdoc</groupId>
    <artifactId>springdoc-openapi-core</artifactId>
    <version>1.1.16</version>
</dependency>
dk7
  • 678
  • 2
  • 10
  • 26