|
1 | 1 | /*
|
2 | 2 | *
|
3 | 3 | * *
|
| 4 | + * * * Copyright 2019-2020 the original author or authors. |
4 | 5 | * * *
|
5 |
| - * * * * Copyright 2019-2022 the original author or authors. |
6 |
| - * * * * |
7 |
| - * * * * Licensed under the Apache License, Version 2.0 (the "License"); |
8 |
| - * * * * you may not use this file except in compliance with the License. |
9 |
| - * * * * You may obtain a copy of the License at |
10 |
| - * * * * |
11 |
| - * * * * https://www.apache.org/licenses/LICENSE-2.0 |
12 |
| - * * * * |
13 |
| - * * * * Unless required by applicable law or agreed to in writing, software |
14 |
| - * * * * distributed under the License is distributed on an "AS IS" BASIS, |
15 |
| - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 |
| - * * * * See the License for the specific language governing permissions and |
17 |
| - * * * * limitations under the License. |
| 6 | + * * * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | + * * * you may not use this file except in compliance with the License. |
| 8 | + * * * You may obtain a copy of the License at |
18 | 9 | * * *
|
| 10 | + * * * https://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * * * |
| 12 | + * * * Unless required by applicable law or agreed to in writing, software |
| 13 | + * * * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * * * See the License for the specific language governing permissions and |
| 16 | + * * * limitations under the License. |
19 | 17 | * *
|
20 | 18 | *
|
21 | 19 | */
|
|
34 | 32 | import org.apache.commons.lang3.StringUtils;
|
35 | 33 | import org.springdoc.core.configuration.SpringDocConfiguration;
|
36 | 34 | import org.springdoc.core.utils.Constants;
|
37 |
| -import org.springdoc.core.utils.SpringDocPropertiesUtils; |
38 | 35 |
|
39 | 36 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
40 | 37 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
@@ -96,6 +93,46 @@ public class SwaggerUiConfigParameters extends AbstractSwaggerUiConfigProperties
|
96 | 93 | */
|
97 | 94 | public static final String QUERY_CONFIG_ENABLED_PROPERTY = "queryConfigEnabled";
|
98 | 95 |
|
| 96 | + /** |
| 97 | + * The constant DISPLAY_OPERATION_ID. |
| 98 | + */ |
| 99 | + public static final String DISPLAY_OPERATION_ID_PROPERTY = "displayOperationId"; |
| 100 | + |
| 101 | + /** |
| 102 | + * The constant DEEP_LINKING. |
| 103 | + */ |
| 104 | + public static final String DEEP_LINKING_PROPERTY ="deepLinking"; |
| 105 | + |
| 106 | + /** |
| 107 | + * The constant DISPLAY_REQUEST_DURATION. |
| 108 | + */ |
| 109 | + public static final String DISPLAY_REQUEST_DURATION_PROPERTY = "displayRequestDuration"; |
| 110 | + |
| 111 | + /** |
| 112 | + * The constant SHOW_EXTENSIONS_PROPERTY. |
| 113 | + */ |
| 114 | + public static final String SHOW_EXTENSIONS_PROPERTY ="showExtensions"; |
| 115 | + |
| 116 | + /** |
| 117 | + * The constant SHOW_COMMON_EXTENSIONS_PROPERTY. |
| 118 | + */ |
| 119 | + public static final String SHOW_COMMON_EXTENSIONS_PROPERTY ="showCommonExtensions"; |
| 120 | + |
| 121 | + /** |
| 122 | + * The constant TRY_IT_ENABLED_PROPERTY. |
| 123 | + */ |
| 124 | + public static final String TRY_IT_ENABLED_PROPERTY ="tryItOutEnabled"; |
| 125 | + |
| 126 | + /** |
| 127 | + * The constant PERSIST_AUTHORIZATION_PROPERTY. |
| 128 | + */ |
| 129 | + public static final String PERSIST_AUTHORIZATION_PROPERTY ="persistAuthorization"; |
| 130 | + |
| 131 | + /** |
| 132 | + * The constant WITH_CREDENTIALS_PROPERTY. |
| 133 | + */ |
| 134 | + public static final String WITH_CREDENTIALS_PROPERTY ="withCredentials"; |
| 135 | + |
99 | 136 | /**
|
100 | 137 | * The Ui root path.
|
101 | 138 | */
|
@@ -210,30 +247,30 @@ public Map<String, Object> getConfigParameters() {
|
210 | 247 | final Map<String, Object> params = new TreeMap<>();
|
211 | 248 | // empty-string prevents swagger-ui default validation
|
212 | 249 | params.put(VALIDATOR_URL_PROPERTY, validatorUrl != null ? validatorUrl : "");
|
213 |
| - SpringDocPropertiesUtils.put(CONFIG_URL_PROPERTY, configUrl, params); |
214 |
| - SpringDocPropertiesUtils.put("deepLinking", this.deepLinking, params); |
215 |
| - SpringDocPropertiesUtils.put("displayOperationId", displayOperationId, params); |
216 |
| - SpringDocPropertiesUtils.put("defaultModelsExpandDepth", defaultModelsExpandDepth, params); |
217 |
| - SpringDocPropertiesUtils.put("defaultModelExpandDepth", defaultModelExpandDepth, params); |
218 |
| - SpringDocPropertiesUtils.put("defaultModelRendering", defaultModelRendering, params); |
219 |
| - SpringDocPropertiesUtils.put("displayRequestDuration", displayRequestDuration, params); |
220 |
| - SpringDocPropertiesUtils.put("docExpansion", docExpansion, params); |
221 |
| - SpringDocPropertiesUtils.put("maxDisplayedTags", maxDisplayedTags, params); |
222 |
| - SpringDocPropertiesUtils.put("showExtensions", showExtensions, params); |
223 |
| - SpringDocPropertiesUtils.put("showCommonExtensions", showCommonExtensions, params); |
224 |
| - SpringDocPropertiesUtils.put("operationsSorter", operationsSorter, params); |
225 |
| - SpringDocPropertiesUtils.put("tagsSorter", tagsSorter, params); |
226 |
| - SpringDocPropertiesUtils.put(SwaggerUiConfigParameters.LAYOUT_PROPERTY, layout , params); |
| 250 | + org.springdoc.core.SpringDocPropertiesUtils.put(CONFIG_URL_PROPERTY, configUrl, params); |
| 251 | + org.springdoc.core.SpringDocPropertiesUtils.put(DEEP_LINKING_PROPERTY, this.deepLinking, params); |
| 252 | + org.springdoc.core.SpringDocPropertiesUtils.put(DISPLAY_OPERATION_ID_PROPERTY, displayOperationId, params); |
| 253 | + org.springdoc.core.SpringDocPropertiesUtils.put("defaultModelsExpandDepth", defaultModelsExpandDepth, params); |
| 254 | + org.springdoc.core.SpringDocPropertiesUtils.put("defaultModelExpandDepth", defaultModelExpandDepth, params); |
| 255 | + org.springdoc.core.SpringDocPropertiesUtils.put("defaultModelRendering", defaultModelRendering, params); |
| 256 | + org.springdoc.core.SpringDocPropertiesUtils.put(DISPLAY_REQUEST_DURATION_PROPERTY, displayRequestDuration, params); |
| 257 | + org.springdoc.core.SpringDocPropertiesUtils.put("docExpansion", docExpansion, params); |
| 258 | + org.springdoc.core.SpringDocPropertiesUtils.put("maxDisplayedTags", maxDisplayedTags, params); |
| 259 | + org.springdoc.core.SpringDocPropertiesUtils.put(SHOW_EXTENSIONS_PROPERTY, showExtensions, params); |
| 260 | + org.springdoc.core.SpringDocPropertiesUtils.put(SHOW_COMMON_EXTENSIONS_PROPERTY, showCommonExtensions, params); |
| 261 | + org.springdoc.core.SpringDocPropertiesUtils.put("operationsSorter", operationsSorter, params); |
| 262 | + org.springdoc.core.SpringDocPropertiesUtils.put("tagsSorter", tagsSorter, params); |
| 263 | + org.springdoc.core.SpringDocPropertiesUtils.put(SwaggerUiConfigParameters.LAYOUT_PROPERTY, layout , params); |
227 | 264 | if (supportedSubmitMethods != null)
|
228 |
| - SpringDocPropertiesUtils.put("supportedSubmitMethods", supportedSubmitMethods.toString(), params); |
229 |
| - SpringDocPropertiesUtils.put(OAUTH2_REDIRECT_URL_PROPERTY, oauth2RedirectUrl, params); |
230 |
| - SpringDocPropertiesUtils.put(URL_PROPERTY, url, params); |
| 265 | + org.springdoc.core.SpringDocPropertiesUtils.put("supportedSubmitMethods", supportedSubmitMethods.toString(), params); |
| 266 | + org.springdoc.core.SpringDocPropertiesUtils.put(OAUTH2_REDIRECT_URL_PROPERTY, oauth2RedirectUrl, params); |
| 267 | + org.springdoc.core.SpringDocPropertiesUtils.put(URL_PROPERTY, url, params); |
231 | 268 | put(URLS_PROPERTY, urls, params);
|
232 |
| - SpringDocPropertiesUtils.put("urls.primaryName", urlsPrimaryName, params); |
233 |
| - SpringDocPropertiesUtils.put("tryItOutEnabled", tryItOutEnabled, params); |
234 |
| - SpringDocPropertiesUtils.put("persistAuthorization", persistAuthorization, params); |
235 |
| - SpringDocPropertiesUtils.put(FILTER_PROPERTY, filter, params); |
236 |
| - SpringDocPropertiesUtils.put("withCredentials", withCredentials, params); |
| 269 | + org.springdoc.core.SpringDocPropertiesUtils.put("urls.primaryName", urlsPrimaryName, params); |
| 270 | + org.springdoc.core.SpringDocPropertiesUtils.put(TRY_IT_ENABLED_PROPERTY, tryItOutEnabled, params); |
| 271 | + org.springdoc.core.SpringDocPropertiesUtils.put(PERSIST_AUTHORIZATION_PROPERTY, persistAuthorization, params); |
| 272 | + org.springdoc.core.SpringDocPropertiesUtils.put(FILTER_PROPERTY, filter, params); |
| 273 | + org.springdoc.core.SpringDocPropertiesUtils.put(WITH_CREDENTIALS_PROPERTY, withCredentials, params); |
237 | 274 | return params;
|
238 | 275 | }
|
239 | 276 |
|
|
0 commit comments