Skip to content

Instantly share code, notes, and snippets.

@indrabasak
Created August 8, 2017 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indrabasak/e13968c5e809f5c754b6a909068ede5e to your computer and use it in GitHub Desktop.
Save indrabasak/e13968c5e809f5c754b6a909068ede5e to your computer and use it in GitHub Desktop.
@Configuration
@EnableSwagger2
public class MultiModuleSwaggerConfiguration {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
.paths(PathSelectors.any())
.build()
.apiInfo(apiInfo("Menagerie API",
"Exploring Swagger UI Features"));
}
/**
* Creates an object containing API information including author name,
* email, version, license, etc.
*
* @param title API title
* @param description API description
* @return API information
*/
private ApiInfo apiInfo(String title, String description) {
Contact contact = new Contact("Indra Basak", "",
"developer@gmail.com");
return new ApiInfo(title, description, "1.0", "terms of controller url",
contact, "license", "license url", Collections.emptyList());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment