Im trying to acces the swagger ui page, but when i'm gonna acces the page, this error comes up
This application has no explicit mapping for /error, so you are seeing this as a fallback
The swagger Config class
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.aluno"))
.paths(regex("/api.*"))
.build()
.apiInfo(metaInfo());
}
private ApiInfo metaInfo() {
ApiInfo apiInfo = new ApiInfo(
"Cursos API REST",
"API REST de registro de alunos.",
"1.0",
"Terms of Service",
new Contact("Romulo Sorato", "https://www.linkedin.com/in/r%C3%B4mulo-sorato-domingos-a6524437/",
"[email protected]"),
"Apache License Version 2.0",
"https://www.apache.org/licesen.html", new ArrayList<>()
);
return apiInfo;
}
}
My pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
Why i cant acces the swagger-ui?
Looks like even tomcat is launching. I added the correct depencies on pom.xml