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 ;
38
+
39
+ import java .util .Collections ;
32
40
33
41
@ Configuration
34
- @ EnableSwagger2
35
42
public class SwaggerConfig {
36
43
37
44
private static final String CONTACT_NAME = "Eiffel Intelligence Maintainers" ;
@@ -51,6 +58,30 @@ public Docket api() {
51
58
.apiInfo (metaData ());
52
59
}
53
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
+
54
85
private ApiInfo metaData () {
55
86
ApiInfo apiInfo = new ApiInfo (
56
87
"Eiffel Intelligence REST API" ,
@@ -59,7 +90,8 @@ private ApiInfo metaData() {
59
90
"Terms of service" ,
60
91
new Contact (CONTACT_NAME , CONTACT_URL , CONTACT_EMAIL ),
61
92
"Apache License Version 2.0" ,
62
- "https://www.apache.org/licenses/LICENSE-2.0" );
93
+ "https://www.apache.org/licenses/LICENSE-2.0" ,
94
+ Collections .emptyList ());
63
95
return apiInfo ;
64
96
}
65
- }
97
+ }
0 commit comments