Skip to content

Commit 5311835

Browse files
committed
Enhance swagger-ui url, disable validation by default, post 1.6.0. Fixes #1384
1 parent 3e8227c commit 5311835

File tree

22 files changed

+43
-22
lines changed

22 files changed

+43
-22
lines changed

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
@@ -171,7 +171,7 @@ protected String addParameters(String html) throws JsonProcessingException {
171171
.filter(entry -> !SwaggerUiConfigParameters.OAUTH2_REDIRECT_URL_PROPERTY.equals(entry.getKey()))
172172
.filter(entry -> !SwaggerUiConfigParameters.URL_PROPERTY.equals(entry.getKey()))
173173
.filter(entry -> !SwaggerUiConfigParameters.URLS_PROPERTY.equals(entry.getKey()))
174-
.filter(entry -> StringUtils.isNotEmpty((String) entry.getValue()))
174+
.filter(entry -> SwaggerUiConfigParameters.VALIDATOR_URL_PROPERTY.equals(entry.getKey()) || StringUtils.isNotEmpty((String) entry.getValue()))
175175
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,(e1, e2) -> e2,
176176
LinkedHashMap::new));
177177

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/v3/api-docs/swagger-config"
54+
"configUrl" : "/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/context-path/servlet-path/v3/api-docs/swagger-config"
54+
"configUrl" : "/context-path/servlet-path/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/documentation/v3/api-docs/swagger-config"
54+
"configUrl" : "/documentation/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/v3/api-docs/swagger-config"
54+
"configUrl" : "/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ presets: [
5252
],
5353
layout: "StandaloneLayout" ,
5454

55-
"configUrl" : "/v3/api-docs/swagger-config"
55+
"configUrl" : "/v3/api-docs/swagger-config",
56+
"validatorUrl" : ""
5657

5758
});
5859
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/rest/v3/api-docs/swagger-config"
54+
"configUrl" : "/rest/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/foo/bar"
54+
"configUrl" : "/foo/bar",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
layout: "BaseLayout" ,
5353

5454
"configUrl" : "/v3/api-docs/swagger-config",
55-
"layout" : "BaseLayout"
55+
"layout" : "BaseLayout",
56+
"validatorUrl" : ""
5657

5758
});
5859
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
layout: "StandaloneLayout" ,
5353

5454
"configUrl" : "/v3/api-docs/swagger-config",
55-
"filter" : "false"
55+
"filter" : "false",
56+
"validatorUrl" : ""
5657

5758
});
5859
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/context-path/v3/api-docs/swagger-config"
54+
"configUrl" : "/context-path/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/context-path/servlet-path/v3/api-docs/swagger-config"
54+
"configUrl" : "/context-path/servlet-path/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/v3/api-docs/swagger-config"
54+
"configUrl" : "/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/v3/api-docs/swagger-config"
54+
"configUrl" : "/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

springdoc-openapi-webflux-ui/src/test/resources/results/index1-configurl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/foo/bar"
54+
"configUrl" : "/foo/bar",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

springdoc-openapi-webflux-ui/src/test/resources/results/index1-default

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/v3/api-docs/swagger-config"
54+
"configUrl" : "/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

springdoc-openapi-webflux-ui/src/test/resources/results/index1-filter

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
layout: "StandaloneLayout" ,
5353

5454
"configUrl" : "/v3/api-docs/swagger-config",
55-
"filter" : "false"
55+
"filter" : "false",
56+
"validatorUrl" : ""
5657

5758
});
5859
// End Swagger UI call region

springdoc-openapi-webflux-ui/src/test/resources/results/index1-layout

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
layout: "BaseLayout" ,
5353

5454
"configUrl" : "/v3/api-docs/swagger-config",
55-
"layout" : "BaseLayout"
55+
"layout" : "BaseLayout",
56+
"validatorUrl" : ""
5657

5758
});
5859
// End Swagger UI call region

springdoc-openapi-webflux-ui/src/test/resources/results/index3

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/documentation/v3/api-docs/swagger-config"
54+
"configUrl" : "/documentation/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

springdoc-openapi-webflux-ui/src/test/resources/results/index5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/v3/api-docs/swagger-config"
54+
"configUrl" : "/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

springdoc-openapi-webflux-ui/src/test/resources/results/index6

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/v3/api-docs/swagger-config"
54+
"configUrl" : "/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

springdoc-openapi-webflux-ui/src/test/resources/results/index7

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
],
5252
layout: "StandaloneLayout" ,
5353

54-
"configUrl" : "/v3/api-docs/swagger-config"
54+
"configUrl" : "/v3/api-docs/swagger-config",
55+
"validatorUrl" : ""
5556

5657
});
5758
// End Swagger UI call region

0 commit comments

Comments
 (0)