9
9
import java .util .TreeMap ;
10
10
11
11
/**
12
- * Please refer to https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md
12
+ * Please refer to the swagger
13
+ * <a href="https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md">configuration.md</a>
13
14
* to get the idea what each parameter does.
14
15
*/
15
16
@ Configuration
16
17
@ ConfigurationProperties (prefix = "springdoc.swagger-ui" )
17
18
public class SwaggerUiConfigProperties {
18
- // URL to fetch external configuration document from.
19
+ /**
20
+ * The path for the Swagger UI pages to load. Will redirect to the springdoc.webjars.prefix property.
21
+ */
22
+ private String path = "/swagger-ui.html" ;
23
+
24
+ /**
25
+ * The name of a component available via the plugin system to use as the top-level layout for Swagger UI.
26
+ */
27
+ private String layout ;
28
+ /**
29
+ * URL to fetch external configuration document from.
30
+ */
19
31
private String configUrl ;
20
- // If set, enables filtering. The top bar will show an edit box that
21
- // could be used to filter the tagged operations that are shown.
32
+ /**
33
+ * If set, enables filtering. The top bar will show an edit box that
34
+ * could be used to filter the tagged operations that are shown.
35
+ */
22
36
private String filter ;
23
37
24
- // Apply a sort to the operation list of each API
38
+ /**
39
+ * Apply a sort to the operation list of each API
40
+ */
25
41
private String operationsSorter ;
26
- // Apply a sort to the tag list of each API
42
+ /**
43
+ * Apply a sort to the tag list of each API
44
+ */
27
45
private String tagsSorter ;
28
46
29
- // Enables or disables deep linking for tags and operations.
47
+ /**
48
+ * Enables or disables deep linking for tags and operations.
49
+ *
50
+ * @see <a href="https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/deep-linking.md">deep-linking.md</a>
51
+ */
30
52
private Boolean deepLinking ;
31
- // Controls the display of operationId in operations list.
53
+ /**
54
+ * Controls the display of operationId in operations list.
55
+ */
32
56
private Boolean displayOperationId ;
33
- // The default expansion depth for models (set to -1 completely hide the models).
57
+ /**
58
+ * The default expansion depth for models (set to -1 completely hide the models).
59
+ */
34
60
private Integer defaultModelsExpandDepth ;
35
- // The default expansion depth for the model on the model-example section.
61
+ /**
62
+ * The default expansion depth for the model on the model-example section.
63
+ */
36
64
private Integer defaultModelExpandDepth ;
37
65
38
- // Controls how the model is shown when the API is first rendered.
66
+ /**
67
+ * Controls how the model is shown when the API is first rendered.
68
+ */
39
69
private String defaultModelRendering ;
40
- // Controls the display of the request duration (in milliseconds) for Try-It-Out requests.
70
+ /**
71
+ * Controls the display of the request duration (in milliseconds) for Try-It-Out requests.
72
+ */
41
73
private Boolean displayRequestDuration ;
42
- // Controls the default expansion setting for the operations and tags.
74
+ /**
75
+ * Controls the default expansion setting for the operations and tags.
76
+ */
43
77
private String docExpansion ;
44
- // If set, limits the number of tagged operations displayed to at most this many.
78
+ /**
79
+ * If set, limits the number of tagged operations displayed to at most this many.
80
+ */
45
81
private Integer maxDisplayedTags ;
46
- // Controls the display of vendor extension (x-) fields and values.
82
+ /**
83
+ * Controls the display of vendor extension (x-) fields and values.
84
+ */
47
85
private Boolean showExtensions ;
48
- // Controls the display of extensions
86
+ /**
87
+ * Controls the display of extensions
88
+ */
49
89
private Boolean showCommonExtensions ;
50
90
51
91
public Map <String , String > getConfigParameters () {
52
92
final Map <String , String > params = new TreeMap <>();
93
+ put ("layout" , layout , params );
53
94
put ("configUrl" , configUrl , params );
54
95
put ("filter" , filter , params );
55
96
put ("deepLinking" , this .deepLinking , params );
@@ -85,6 +126,22 @@ protected void put(final String name, final String value, final Map<String, Stri
85
126
}
86
127
}
87
128
129
+ public String getPath () {
130
+ return path ;
131
+ }
132
+
133
+ public void setPath (String path ) {
134
+ this .path = path ;
135
+ }
136
+
137
+ public String getLayout () {
138
+ return layout ;
139
+ }
140
+
141
+ public void setLayout (String layout ) {
142
+ this .layout = layout ;
143
+ }
144
+
88
145
public String getConfigUrl () {
89
146
return configUrl ;
90
147
}
@@ -101,6 +158,22 @@ public void setFilter(String filter) {
101
158
this .filter = filter ;
102
159
}
103
160
161
+ public String getOperationsSorter () {
162
+ return operationsSorter ;
163
+ }
164
+
165
+ public void setOperationsSorter (String operationsSorter ) {
166
+ this .operationsSorter = operationsSorter ;
167
+ }
168
+
169
+ public String getTagsSorter () {
170
+ return tagsSorter ;
171
+ }
172
+
173
+ public void setTagsSorter (String tagsSorter ) {
174
+ this .tagsSorter = tagsSorter ;
175
+ }
176
+
104
177
public Boolean getDeepLinking () {
105
178
return deepLinking ;
106
179
}
@@ -180,20 +253,4 @@ public Boolean getShowCommonExtensions() {
180
253
public void setShowCommonExtensions (Boolean showCommonExtensions ) {
181
254
this .showCommonExtensions = showCommonExtensions ;
182
255
}
183
-
184
- public String getOperationsSorter () {
185
- return operationsSorter ;
186
- }
187
-
188
- public void setOperationsSorter (String operationsSorter ) {
189
- this .operationsSorter = operationsSorter ;
190
- }
191
-
192
- public String getTagsSorter () {
193
- return tagsSorter ;
194
- }
195
-
196
- public void setTagsSorter (String tagsSorter ) {
197
- this .tagsSorter = tagsSorter ;
198
- }
199
256
}
0 commit comments