I have a REST application using Spring Boot 2.2.4.RELEASE. My REST controller is annotated like
@RestController
@RequestMapping("/")
My REST controller has @GetMapping
, @PostMapping
, etc., it works as expected.
Now I want to integrate Swagger in latest version.
https://github.com/swagger-api/swagger-core
https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Getting-started
The Maven dependencies shown there I added to my pom.xml:
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-core</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-models</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-integration</artifactId>
<version>2.1.1</version>
</dependency>
According to the 'Getting Started', just by adding the dependencies I should see the generated OpenAPI at http://localhost:8080/openapi.json but nothing shows up there.
Is Swagger (swagger-core,... in version 2.1.1) usable with Spring Boot web applications?
There is a project SpringFox, but it is not up to date. Also springdoc-openapi is available. But using Swagger directly would be my first thought.