Revision 49960
Added by Panagiotis Kanakakis over 6 years ago
SwaggerConfig.java | ||
---|---|---|
3 | 3 |
import org.springframework.context.annotation.Bean; |
4 | 4 |
import org.springframework.context.annotation.Configuration; |
5 | 5 |
import org.springframework.web.servlet.config.annotation.EnableWebMvc; |
6 |
import springfox.documentation.builders.PathSelectors; |
|
6 | 7 |
import springfox.documentation.builders.RequestHandlerSelectors; |
7 | 8 |
import springfox.documentation.service.ApiInfo; |
8 | 9 |
import springfox.documentation.service.Contact; |
... | ... | |
21 | 22 |
@Configuration |
22 | 23 |
@EnableSwagger2 |
23 | 24 |
@EnableWebMvc |
24 |
public class SwaggerConfig { |
|
25 |
public class SwaggerConfig {
|
|
25 | 26 |
|
26 | 27 |
@Bean |
27 | 28 |
public Docket productApi() { |
28 | 29 |
return new Docket(DocumentationType.SWAGGER_2) |
29 | 30 |
.apiInfo(getApiInfo()) |
30 | 31 |
.select() |
31 |
.apis(RequestHandlerSelectors.basePackage("eu.dnetlib.repo.manager.service.controllers"))
|
|
32 |
.paths(regex("/repository.*"))
|
|
32 |
.apis(RequestHandlerSelectors.basePackage(("eu.dnetlib.repo.manager.service.controller")))
|
|
33 |
.paths(PathSelectors.any())
|
|
33 | 34 |
.build(); |
34 | 35 |
} |
35 | 36 |
|
36 | 37 |
private ApiInfo getApiInfo() { |
37 |
return new ApiInfo("REST Api Documentation",
|
|
38 |
"REST Api Documentation",
|
|
38 |
return new ApiInfo("Repository Manager Dashboard API Documentation",
|
|
39 |
"Repository Manager Dashboard API Documentation",
|
|
39 | 40 |
"1.0", |
40 | 41 |
"urn:tos", |
41 | 42 |
new Contact("", "", ""), |
Also available in: Unified diff
1. Change storeRepository method
2. Update converter of repository interface with extra fields.