@EnableSwagger2
@Configuration
public class SwaggerConfig {
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.techprimers.springboot.swaggerexample"))
.paths(regex("/rest.*"))
.build()
.apiInfo(metaInfo());
private ApiInfo metaInfo() {
ApiInfo apiInfo = new ApiInfo(
"Spring Boot Swagger Example API",
"Spring Boot Swagger Example API for Youtube",
"1.0",
"Terms of Service",
new Contact("TechPrimers", "https://www.youtube.com/TechPrimers",
"techprimerschannel@gmail.com"),
"Apache License Version 2.0",
"https://www.apache.org/licesen.html"
return apiInfo;
}