Skip to content

Commit a47a68e

Browse files
authored
Uplift to Swagger 3.0.0 (#240)
* Uplift to Swagger 3.0.0
1 parent 006738a commit a47a68e

File tree

4 files changed

+31
-13
lines changed

4 files changed

+31
-13
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.github.eiffel-community</groupId>
88
<artifactId>eiffel-remrem-parent</artifactId>
9-
<version>2.0.14</version>
9+
<version>2.0.15</version>
1010
</parent>
1111

1212
<properties>

service/pom.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,7 @@
8585
</dependency>
8686
<dependency>
8787
<groupId>io.springfox</groupId>
88-
<artifactId>springfox-swagger2</artifactId>
89-
</dependency>
90-
<dependency>
91-
<groupId>io.springfox</groupId>
92-
<artifactId>springfox-swagger-ui</artifactId>
88+
<artifactId>springfox-boot-starter</artifactId>
9389
</dependency>
9490
<dependency>
9591
<groupId>org.springframework.boot</groupId>

service/src/main/java/com/ericsson/eiffel/remrem/generate/config/SwaggerConfig.java

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@
4848
import springfox.documentation.swagger.web.UiConfiguration.Constants;
4949
import springfox.documentation.swagger2.annotations.EnableSwagger2;
5050

51+
import springfox.documentation.swagger.web.DocExpansion;
52+
import springfox.documentation.swagger.web.ModelRendering;
53+
import springfox.documentation.swagger.web.OperationsSorter;
54+
import springfox.documentation.swagger.web.TagsSorter;
55+
import springfox.documentation.swagger.web.UiConfiguration;
56+
import springfox.documentation.swagger.web.UiConfigurationBuilder;
57+
5158
@Configuration
52-
@EnableSwagger2
5359
public class SwaggerConfig {
5460

5561
@Bean
@@ -62,11 +68,27 @@ public Docket api() {
6268
.apiInfo(metaData());
6369
}
6470

65-
@Bean
66-
public UiConfiguration uiConfig() {
67-
return new UiConfiguration(null, "list", "alpha", "schema", Constants.DEFAULT_SUBMIT_METHODS, false, true,
68-
null);
69-
}
71+
@Bean
72+
public UiConfiguration uiConfig() {
73+
74+
return UiConfigurationBuilder.builder()
75+
.deepLinking(true)
76+
.displayOperationId(false)
77+
.defaultModelsExpandDepth(-1)
78+
.defaultModelExpandDepth(1)
79+
.defaultModelRendering(ModelRendering.EXAMPLE)
80+
.displayRequestDuration(false)
81+
.docExpansion(DocExpansion.NONE)
82+
.filter(false)
83+
.maxDisplayedTags(null)
84+
.operationsSorter(OperationsSorter.ALPHA)
85+
.showExtensions(false)
86+
.tagsSorter(TagsSorter.ALPHA)
87+
.supportedSubmitMethods(UiConfiguration.Constants.DEFAULT_SUBMIT_METHODS)
88+
.validatorUrl(null)
89+
.build();
90+
}
91+
7092

7193
@Bean
7294
public WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping(WebEndpointsSupplier webEndpointsSupplier,

service/src/main/java/com/ericsson/eiffel/remrem/generate/controller/RemremHomeController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ public class RemremHomeController {
2828

2929
@RequestMapping(value = "/", method = RequestMethod.GET)
3030
public String home() {
31-
return "redirect:/swagger-ui.html";
31+
return "redirect:/swagger-ui/index.html";
3232
}
3333
}

0 commit comments

Comments
 (0)