I have a problem with Swagger configuration.
Right now Swagger is scanning for packages and creating nice documentation, but I would like to use my YAML (or JSON if YAML usage is not possible) file.
This is my Swagger configuration class:
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.myapp.rest"))
.paths(PathSelectors.any())
.build();
}
}
I would like to write examples of usage in YAML file, so Swagger can display them. How can I change/add configuration for Swagger to pick up my YAML file?