Reading configuration parameters from URL search params is by default no longer enabled. To re-enable it, set queryConfigEnabled configuration parameter to true. Functionally, this is a breaking change, but given we're just providing a security vulnerability patch we're considering this a PATCH version bump only. Refs #4872 Refs https://github.com/swagger-api/swagger-ui/security/advisories/GHSA-qrmm-w75w-3wpx
1.7 KiB
1.7 KiB
<html lang="en">
<head>
<style>
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
body {
margin: 0;
background: #fafafa;
}
</style>
</head>
<script src="/swagger-ui-bundle.js" charset="UTF-8"> </script>
<script src="/swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
<script>
window.onload = function () {
window["SwaggerUIBundle"] = window["swagger-ui-bundle"]
window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"]
// Build a system
const ui = SwaggerUIBundle({
url: "https://petstore.swagger.io/v2/swagger.json",
urls: [
{
name: "USPTO",
url: "./uspto.yaml"
},
{
name: "Examples",
url: "./api-with-examples.yaml"
},
],
dom_id: '#swagger-ui',
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout",
onComplete: () => {
if (window.completeCount) {
window.completeCount++
} else {
window.completeCount = 1
}
},
queryConfigEnabled: true,
})
window.ui = ui
}
</script>
</html>