Skip to content

Instantly share code, notes, and snippets.

@saurzcode
Created August 19, 2014 06:04
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 saurzcode/9dcee7110707ff996784 to your computer and use it in GitHub Desktop.
Save saurzcode/9dcee7110707ff996784 to your computer and use it in GitHub Desktop.
Swagger Java Configuration
@Configuration
@EnableSwagger
public class SwaggerConfig {
private SpringSwaggerConfig springSwaggerConfig;
@Autowired
public void setSpringSwaggerConfig(SpringSwaggerConfig springSwaggerConfig) {
this.springSwaggerConfig = springSwaggerConfig;
}
@Bean
// Don't forget the @Bean annotation
public SwaggerSpringMvcPlugin customImplementation() {
return new SwaggerSpringMvcPlugin(this.springSwaggerConfig).apiInfo(
apiInfo()).includePatterns("/saurzcode/.*");
}
private ApiInfo apiInfo() {
ApiInfo apiInfo = new ApiInfo("SaurzCode API", "API for Saurzcode",
"Saurzcode API terms of service", "mail2saurzcode@gmail.com",
"Saurzcode API Licence Type", "Saurzcode API License URL");
return apiInfo;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment