Skip to content

Commit f4b2b64

Browse files
authored
Uplift swagger to 3.0.0 (#307)
1 parent b23a6a9 commit f4b2b64

File tree

6 files changed

+30
-39
lines changed

6 files changed

+30
-39
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
<properties>
1212
<eiffel-remrem-publish.version>2.1.7</eiffel-remrem-publish.version>

publish-cli/pom.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,6 @@
6464
<version>${springboot.version}</version>
6565
<scope>compile</scope>
6666
</dependency>
67-
<dependency>
68-
<groupId>io.springfox</groupId>
69-
<artifactId>springfox-swagger2</artifactId>
70-
<scope>compile</scope>
71-
<exclusions>
72-
<exclusion>
73-
<groupId>com.fasterxml.jackson.core</groupId>
74-
<artifactId>jackson-annotations</artifactId>
75-
</exclusion>
76-
</exclusions>
77-
</dependency>
78-
<dependency>
79-
<groupId>io.springfox</groupId>
80-
<artifactId>springfox-swagger-ui</artifactId>
81-
<scope>compile</scope>
82-
</dependency>
8367
<dependency>
8468
<groupId>com.github.ulisesbocchio</groupId>
8569
<artifactId>jasypt-spring-boot-starter</artifactId>

publish-common/pom.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,8 @@
6464
</dependency>
6565
<dependency>
6666
<groupId>io.springfox</groupId>
67-
<artifactId>springfox-swagger2</artifactId>
68-
<scope>compile</scope>
69-
</dependency>
70-
<dependency>
71-
<groupId>io.springfox</groupId>
72-
<artifactId>springfox-swagger-ui</artifactId>
67+
<artifactId>springfox-boot-starter</artifactId>
68+
<version>${springfox-boot-starter.version}</version>
7369
<scope>compile</scope>
7470
</dependency>
7571
<dependency>

publish-service/pom.xml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,8 @@
7272
</dependency>
7373
<dependency>
7474
<groupId>io.springfox</groupId>
75-
<artifactId>springfox-swagger2</artifactId>
76-
<scope>compile</scope>
77-
<exclusions>
78-
<exclusion>
79-
<groupId>com.fasterxml.jackson.core</groupId>
80-
<artifactId>jackson-annotations</artifactId>
81-
</exclusion>
82-
</exclusions>
83-
</dependency>
84-
<dependency>
85-
<groupId>io.springfox</groupId>
86-
<artifactId>springfox-swagger-ui</artifactId>
75+
<artifactId>springfox-boot-starter</artifactId>
76+
<version>${springfox-boot-starter.version}</version>
8777
<scope>compile</scope>
8878
</dependency>
8979
<dependency>

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

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,14 @@
4646
import springfox.documentation.swagger.web.UiConfiguration.Constants;
4747
import springfox.documentation.swagger2.annotations.EnableSwagger2;
4848

49+
import springfox.documentation.swagger.web.DocExpansion;
50+
import springfox.documentation.swagger.web.ModelRendering;
51+
import springfox.documentation.swagger.web.OperationsSorter;
52+
import springfox.documentation.swagger.web.TagsSorter;
53+
import springfox.documentation.swagger.web.UiConfiguration;
54+
import springfox.documentation.swagger.web.UiConfigurationBuilder;
55+
4956
@Configuration
50-
@EnableSwagger2
5157
public class SwaggerConfig {
5258

5359
@Bean
@@ -63,8 +69,23 @@ public Docket api() {
6369

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

7091
@Bean

publish-service/src/main/java/com/ericsson/eiffel/remrem/publish/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)