29
29
import springfox .documentation .spi .DocumentationType ;
30
30
import springfox .documentation .spring .web .plugins .Docket ;
31
31
import springfox .documentation .swagger2 .annotations .EnableSwagger2 ;
32
+ import springfox .documentation .swagger .web .DocExpansion ;
33
+ import springfox .documentation .swagger .web .ModelRendering ;
34
+ import springfox .documentation .swagger .web .OperationsSorter ;
35
+ import springfox .documentation .swagger .web .TagsSorter ;
36
+ import springfox .documentation .swagger .web .UiConfiguration ;
37
+ import springfox .documentation .swagger .web .UiConfigurationBuilder ;
32
38
33
- import java .util .ArrayList ;
39
+ import java .util .Collections ;
34
40
35
41
@ Configuration
36
42
public class SwaggerConfig {
@@ -52,6 +58,30 @@ public Docket api() {
52
58
.apiInfo (metaData ());
53
59
}
54
60
61
+ /**
62
+ * SwaggerUI information
63
+ */
64
+
65
+ @ Bean
66
+ UiConfiguration uiConfig () {
67
+ return UiConfigurationBuilder .builder ()
68
+ .deepLinking (true )
69
+ .displayOperationId (false )
70
+ .defaultModelsExpandDepth (-1 )
71
+ .defaultModelExpandDepth (1 )
72
+ .defaultModelRendering (ModelRendering .EXAMPLE )
73
+ .displayRequestDuration (false )
74
+ .docExpansion (DocExpansion .NONE )
75
+ .filter (false )
76
+ .maxDisplayedTags (null )
77
+ .operationsSorter (OperationsSorter .ALPHA )
78
+ .showExtensions (false )
79
+ .tagsSorter (TagsSorter .ALPHA )
80
+ .supportedSubmitMethods (UiConfiguration .Constants .DEFAULT_SUBMIT_METHODS )
81
+ .validatorUrl (null )
82
+ .build ();
83
+ }
84
+
55
85
private ApiInfo metaData () {
56
86
ApiInfo apiInfo = new ApiInfo (
57
87
"Eiffel Intelligence REST API" ,
@@ -61,7 +91,7 @@ private ApiInfo metaData() {
61
91
new Contact (CONTACT_NAME , CONTACT_URL , CONTACT_EMAIL ),
62
92
"Apache License Version 2.0" ,
63
93
"https://www.apache.org/licenses/LICENSE-2.0" ,
64
- new ArrayList <> ());
94
+ Collections . emptyList ());
65
95
return apiInfo ;
66
96
}
67
- }
97
+ }
0 commit comments