This commit is contained in:
mmoeller
2023-01-05 10:44:38 +01:00
parent b992fd42ba
commit 9d349584ac
35 changed files with 3400 additions and 2666 deletions

View File

@@ -41,7 +41,7 @@ window.onload = function() {
}).observe(document, {childList: true, subtree: true});
const data = JSON.parse(document.getElementById('swagger-data').innerText);
const ui = SwaggerUIBundle({
const ui = SwaggerUIBundle(Object.assign({
spec: data.spec,
dom_id: '#swagger-ui',
validatorUrl: null,
@@ -54,7 +54,7 @@ window.onload = function() {
SwaggerUIBundle.plugins.DownloadUrl,
],
layout: 'StandaloneLayout',
});
}, data.extraConfiguration));
if (data.oauth.enabled) {
ui.initOAuth({
@@ -63,7 +63,8 @@ window.onload = function() {
realm: data.oauth.type,
appName: data.spec.info.title,
scopeSeparator: ' ',
additionalQueryStringParams: {}
additionalQueryStringParams: {},
usePkceWithAuthorizationCodeGrant: data.oauth.pkce,
});
}
@@ -148,4 +149,8 @@ window.onload = function() {
}, 10000);
});
}
// Make SwaggerUIBundle and data available for some other scripts
window.swaggerUI = ui;
window.swaggerData = data;
};