Skip to content

Commit 8393afc

Browse files
committed
Disable validation for 1.6.1. Fixes #1386.
1 parent aaee0fc commit 8393afc

File tree

23 files changed

+52
-10
lines changed

23 files changed

+52
-10
lines changed

springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiConfigParameters.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ public class SwaggerUiConfigParameters extends AbstractSwaggerUiConfigProperties
8181
*/
8282
public static final String OAUTH2_REDIRECT_URL_PROPERTY = "oauth2RedirectUrl";
8383

84+
/**
85+
* The constant VALIDATOR_URL_PROPERTY.
86+
*/
87+
public static final String VALIDATOR_URL_PROPERTY ="validatorUrl";
88+
8489
/**
8590
* The Ui root path.
8691
*/
@@ -193,7 +198,7 @@ public boolean isValidUrl(String url) {
193198
public Map<String, Object> getConfigParameters() {
194199
final Map<String, Object> params = new TreeMap<>();
195200
// empty-string prevents swagger-ui default validation
196-
params.put("validatorUrl", validatorUrl != null ? validatorUrl : "");
201+
params.put(VALIDATOR_URL_PROPERTY, validatorUrl != null ? validatorUrl : "");
197202
SpringDocPropertiesUtils.put(CONFIG_URL_PROPERTY, configUrl, params);
198203
SpringDocPropertiesUtils.put("deepLinking", this.deepLinking, params);
199204
SpringDocPropertiesUtils.put("displayOperationId", displayOperationId, params);

springdoc-openapi-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ protected String addParameters(String html) throws JsonProcessingException {
173173
.filter(entry -> !SwaggerUiConfigParameters.OAUTH2_REDIRECT_URL_PROPERTY.equals(entry.getKey()) || !Constants.SWAGGER_UI_OAUTH_REDIRECT_URL.equals(entry.getValue()))
174174
.filter(entry -> !SwaggerUiConfigParameters.URL_PROPERTY.equals(entry.getKey()))
175175
.filter(entry -> !SwaggerUiConfigParameters.LAYOUT_PROPERTY.equals(entry.getKey()))
176-
.filter(entry -> SwaggerUiConfigParameters.URLS_PROPERTY.equals(entry.getKey()) || StringUtils.isNotEmpty((String) entry.getValue()))
176+
.filter(entry -> SwaggerUiConfigParameters.URLS_PROPERTY.equals(entry.getKey()) || SwaggerUiConfigParameters.VALIDATOR_URL_PROPERTY.equals(entry.getKey()) || StringUtils.isNotEmpty((String) entry.getValue()))
177177
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
178178

179179
if (!CollectionUtils.isEmpty(parametersObjectMap)) {

springdoc-openapi-ui/src/test/resources/results/app1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@
4949
plugins: [
5050
SwaggerUIBundle.plugins.DownloadUrl
5151
],
52-
layout: "StandaloneLayout"
52+
layout: "StandaloneLayout" ,
53+
54+
"validatorUrl" : ""
55+
5356
});
5457
// End Swagger UI call region
5558

springdoc-openapi-ui/src/test/resources/results/app1-contextpath

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54+
"validatorUrl" : "",
5455
"oauth2RedirectUrl" : "http://localhost/context-path/servlet-path/test/swagger-ui/oauth2-redirect.html"
5556

5657
});

springdoc-openapi-ui/src/test/resources/results/app1-prefix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54+
"validatorUrl" : "",
5455
"oauth2RedirectUrl" : "http://localhost/documentation/swagger-ui/oauth2-redirect.html"
5556

5657
});

springdoc-openapi-ui/src/test/resources/results/app10

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@
4949
plugins: [
5050
SwaggerUIBundle.plugins.DownloadUrl
5151
],
52-
layout: "StandaloneLayout"
52+
layout: "StandaloneLayout" ,
53+
54+
"validatorUrl" : ""
55+
5356
});
5457
// End Swagger UI call region
5558

springdoc-openapi-ui/src/test/resources/results/app12

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ presets: [
5050
plugins: [
5151
SwaggerUIBundle.plugins.DownloadUrl
5252
],
53-
layout: "StandaloneLayout"
53+
layout: "StandaloneLayout" ,
54+
55+
"validatorUrl" : ""
56+
5457
});
5558
// End Swagger UI call region
5659

springdoc-openapi-ui/src/test/resources/results/app21

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54+
"validatorUrl" : "",
5455
"oauth2RedirectUrl" : "http://localhost/swagger-ui/oauth2-redirect.html"
5556

5657
});

springdoc-openapi-ui/src/test/resources/results/app24

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54+
"validatorUrl" : "",
5455
"configUrl" : "/foo/bar",
5556
"oauth2RedirectUrl" : "http://localhost/swagger-ui/oauth2-redirect.html"
5657

springdoc-openapi-ui/src/test/resources/results/app26

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
],
5252
layout: "BaseLayout" ,
5353

54+
"validatorUrl" : "",
5455
"oauth2RedirectUrl" : "http://localhost/swagger-ui/oauth2-redirect.html"
5556

5657
});

0 commit comments

Comments
 (0)