Created
August 19, 2014 06:04
-
-
Save saurzcode/9dcee7110707ff996784 to your computer and use it in GitHub Desktop.
Swagger Java Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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