How to disable swagger 3 configuration in spring boot - swagger

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.

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>

Related

Thymeleaf configuration with springORM applcation

I need to use thymeleaf instead of jsp in a SpringORM application, I'm looking for the configuration setting for this purpose.
create a simple spring boot project from https://start.spring.io/ and then add thymeleaf in your maven repository like below
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring3</artifactId>
<version>3.0.11.RELEASE</version>
</dependency>
N.B: You can also chhose thymeleaf as a dependency when you create the project.

Adding an API definition manually in swagger using springfox

I am using springfox for generating Swagger API documentation for REST APIs exposed by a spring boot application.
I need to add documentation for an API manually for which there is no REST controller, technically. How can I manually add to the Swagger API documentation? I want to do it once from the code.
You can create it using plugins mechanism. Create ApiListingScannerPlugin to dynamic added ApiDescription and OperationModelsProviderPlugin to dynamic added Definitions

How to integrate swagger documentation on resteasy 3?

I have resteasy 3 rest web-services for which I want to add swagger documentation. I'm using Maven. I found many tutorials for jersey and spring but not for resteasy.
I created a example https://github.com/diegogusava/togus
This class do all the work: https://github.com/diegogusava/togus/blob/master/togus-rest/src/main/java/br/com/diegogusava/togus/infrastructure/RestConfiguration.java

Whats the right swagger tool/plugin to generate Swagger 2.0 jsons out of JaxRS annoations which works with ANT?

We use Apache Ant for our project build and were thinking of extending the same for getting swagger 2.0 specs .json generated for our REST API docs. I found an ant task : https://github.com/cstroe/swagger-ant-task
which would invoke the same swagger core maven plugin, but some dependency jars have been changed in the github package due to which I am getting 'No Such Method' Exception for getApiInfo() method in ApiSourceInfo.java.
We cannot use maven just for generating API docs. I needed some help in finding a way by which I can use swagger core tool of generating docs using swagger annotations in the API definition file. Using ant wrapper for the maven plugin was one way but I am not not able to leverage it. Is there any other workaround?
Or to frame it otherwise, whats the right swagger tool/plugin to generate Swagger 2.0 jsons out of JaxRS annoations which works with ANT.
Any suggestion would be much appreciated.
Thanks

Swagger spec in Swagger Core Jersey 1.X

I am using Swagger with Jersey 1. It generates spec in Swagger spec v1.2. Most of the tools out there (e.g. Editor ) require spec v2.0. Is there a way to generate spec v2.0 ?
I actually wanted printable/static docs like bootprint-swagger which also required spec v2.0.
I have not tried it myself, but https://github.com/lucybot/api-spec-converter seems to be able to convert Swagger 1.2 to Swagger 2.0
I'm not sure if it is an "official" Swagger-Tool, but it is just two clicks away from the Swagger-1.2-to-2.0-Migration-Guide, so I guess its like "half-official" at least.
I might try to incoorporate it into bootprint-swagger so that it supports Swagger 1.2 as well. I've just created an issue at github so that it is not forgotten.

Resources