I've started to develop a small springboot application and I wanted to document it's API (every existing endpoint) using Swagger. However, doesn't matter which version of Swagger I'm trying to implement, I always end up with 404 response code while trying to access swagger-ui (and other endpoints provided by Swagger). I'd be thankful for help from someone who has successfully fixed that issue or have suspicions of how to fix it. I'll provide information about my project if needed.
I've tried different swagger versions, url mapping, different configurations (even tho in newer one apparently all i needed was the dependency, still didn't work tho).
https://github.com/ryszard-urbanek/movie-base - this is the current state of the project, below I give a code sample of what I'm trying to add
@SpringBootApplication
@EnableSwagger2
public class MovieBaseApplication {
@Bean
public Docket get() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any()) // Updated path
.build()
.host("http://localhost:8080");
}
public static void main(String[] args) {
ApplicationContext context = SpringApplication.run(MovieBaseApplication.class, args);
}
}
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency>