1
1
package org .springdoc .core ;
2
2
3
-
4
3
import org .apache .commons .lang3 .StringUtils ;
5
4
import org .springframework .boot .autoconfigure .condition .ConditionalOnBean ;
6
5
import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
@@ -137,55 +136,30 @@ public static void addUrl(String url) {
137
136
138
137
public Map <String , Object > getConfigParameters () {
139
138
final Map <String , Object > params = new TreeMap <>();
140
- put ("layout" , layout , params );
141
- put (CONFIG_URL_PROPERTY , configUrl , params );
142
- put ("validatorUrl" , validatorUrl , params );
143
- put ("filter" , filter , params );
144
- put ("deepLinking" , this .deepLinking , params );
145
- put ("displayOperationId" , displayOperationId , params );
146
- put ("defaultModelsExpandDepth" , defaultModelsExpandDepth , params );
147
- put ("defaultModelExpandDepth" , defaultModelExpandDepth , params );
148
- put ("defaultModelRendering" , defaultModelRendering , params );
149
- put ("displayRequestDuration" , displayRequestDuration , params );
150
- put ("docExpansion" , docExpansion , params );
151
- put ("maxDisplayedTags" , maxDisplayedTags , params );
152
- put ("showExtensions" , showExtensions , params );
153
- put ("showCommonExtensions" , showCommonExtensions , params );
154
- put ("operationsSorter" , operationsSorter , params );
155
- put ("tagsSorter" , tagsSorter , params );
139
+ SpringDocPropertiesUtils . put ("layout" , layout , params );
140
+ SpringDocPropertiesUtils . put (CONFIG_URL_PROPERTY , configUrl , params );
141
+ SpringDocPropertiesUtils . put ("validatorUrl" , validatorUrl , params );
142
+ SpringDocPropertiesUtils . put ("filter" , filter , params );
143
+ SpringDocPropertiesUtils . put ("deepLinking" , this .deepLinking , params );
144
+ SpringDocPropertiesUtils . put ("displayOperationId" , displayOperationId , params );
145
+ SpringDocPropertiesUtils . put ("defaultModelsExpandDepth" , defaultModelsExpandDepth , params );
146
+ SpringDocPropertiesUtils . put ("defaultModelExpandDepth" , defaultModelExpandDepth , params );
147
+ SpringDocPropertiesUtils . put ("defaultModelRendering" , defaultModelRendering , params );
148
+ SpringDocPropertiesUtils . put ("displayRequestDuration" , displayRequestDuration , params );
149
+ SpringDocPropertiesUtils . put ("docExpansion" , docExpansion , params );
150
+ SpringDocPropertiesUtils . put ("maxDisplayedTags" , maxDisplayedTags , params );
151
+ SpringDocPropertiesUtils . put ("showExtensions" , showExtensions , params );
152
+ SpringDocPropertiesUtils . put ("showCommonExtensions" , showCommonExtensions , params );
153
+ SpringDocPropertiesUtils . put ("operationsSorter" , operationsSorter , params );
154
+ SpringDocPropertiesUtils . put ("tagsSorter" , tagsSorter , params );
156
155
if (!CollectionUtils .isEmpty (supportedSubmitMethods ))
157
- put ("supportedSubmitMethods" , supportedSubmitMethods .toString (), params );
158
- put ("oauth2RedirectUrl" , oauth2RedirectUrl , params );
159
- put ("url" , url , params );
156
+ SpringDocPropertiesUtils . put ("supportedSubmitMethods" , supportedSubmitMethods .toString (), params );
157
+ SpringDocPropertiesUtils . put ("oauth2RedirectUrl" , oauth2RedirectUrl , params );
158
+ SpringDocPropertiesUtils . put ("url" , url , params );
160
159
put ("urls" , swaggerUrls , params );
161
160
return params ;
162
161
}
163
162
164
- protected void put (String urls , List <SwaggerUrl > swaggerUrls , Map <String , Object > params ) {
165
- swaggerUrls = swaggerUrls .stream ().filter (elt -> StringUtils .isNotEmpty (elt .getUrl ())).collect (Collectors .toList ());
166
- if (!CollectionUtils .isEmpty (swaggerUrls )) {
167
- params .put (urls , swaggerUrls );
168
- }
169
- }
170
-
171
- protected void put (final String name , final Integer value , final Map <String , Object > params ) {
172
- if (value != null ) {
173
- params .put (name , value .toString ());
174
- }
175
- }
176
-
177
- protected void put (final String name , final Boolean value , final Map <String , Object > params ) {
178
- if (value != null ) {
179
- params .put (name , value .toString ());
180
- }
181
- }
182
-
183
- protected void put (final String name , final String value , final Map <String , Object > params ) {
184
- if (!StringUtils .isEmpty (value )) {
185
- params .put (name , value );
186
- }
187
- }
188
-
189
163
public String getValidatorUrl () {
190
164
return validatorUrl ;
191
165
}
@@ -384,4 +358,11 @@ public void setName(String name) {
384
358
this .name = name ;
385
359
}
386
360
}
361
+
362
+ private void put (String urls , List <SwaggerUrl > swaggerUrls , Map <String , Object > params ) {
363
+ swaggerUrls = swaggerUrls .stream ().filter (elt -> StringUtils .isNotEmpty (elt .getUrl ())).collect (Collectors .toList ());
364
+ if (!CollectionUtils .isEmpty (swaggerUrls )) {
365
+ params .put (urls , swaggerUrls );
366
+ }
367
+ }
387
368
}
0 commit comments