Swagger Documentations

less than 1 minute read

Swagger Dcoumentation

Add Maven Dependencies

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

<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.9.2</version>
</dependency>

Add a Swagger Config Class

@Configuration
@EnableSwagger2
public class SwaggerConfig {

    @Bean
    public Docket api(){
        return new Docket(DocumentationType.SWAGGER_2)
    }
}

Access the Swagger Docs via

[http://localhost:8089/v2/api-docs]

Swagger UI [http://localhost:8089/swagger-ui.html]

TODO

  • Configure further docs via swagger Annotations