Académique Documents
Professionnel Documents
Culture Documents
UP ASI
Bureau E204
– Introduction
– Swagger
– Intégration Swagger
– Configuration Swagger
– Place à la pratique
– TP
© 2021-2022 – ESPRIT – Module Architecture des SI II (Spring) 2
Introduction
@Configuration
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
}
http://localhost:8089/SpringMVC/v2/api-docs
• Informations personnalisées
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build().apiInfo(apiInfo());
}
private ApiInfo apiInfo () {
return new ApiInfoBuilder()
.title("Swagger Configuration for tpStockProject")
.description("\"Spring Boot Swagger configuration\"")
.version("1.1.0").build();
}
Ajouter un client
Département Informatique
UP ASI
Bureau E204