Documentation with Swagger

Asked

Viewed 59 times

0

Hello, everyone.

I’m having trouble analyzing my documentation with Swagger. It just doesn’t show up anything but some HTML elements on my page localhost:8080/swagger-ui.html, how the image shows:

inserir a descrição da imagem aqui

In my pom.xml, the dependencies are arrows in this way:

    <!-- Swagger -->
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>2.9.2</version>
    </dependency>
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.9.2</version>
    </dependency>

And my class SwaggerConfig is this way:

@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            .apis(RequestHandlerSelectors.any())
            .paths(PathSelectors.ant("/api/**"))
            .build()
            .apiInfo(apiInfo());
}

private ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .contact(new Contact("meu_nome", "", "[email protected]"))
            .title("API SIGEFES")
            .description("API")
            .version("1.0")
            .build();
    }
}

How should I proceed? Someone could help me?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.