diff --git a/dev-helpers/dev-helper-initializer.js b/dev-helpers/dev-helper-initializer.js new file mode 100644 index 00000000000..aaf2624aeb2 --- /dev/null +++ b/dev-helpers/dev-helper-initializer.js @@ -0,0 +1,31 @@ +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", + dom_id: '#swagger-ui', + presets: [ + SwaggerUIBundle.presets.apis, + SwaggerUIStandalonePreset + ], + plugins: [ + SwaggerUIBundle.plugins.DownloadUrl + ], + layout: "StandaloneLayout" + }) + + window.ui = ui + + ui.initOAuth({ + clientId: "your-client-id", + clientSecret: "your-client-secret-if-required", + realm: "your-realms", + appName: "your-app-name", + scopeSeparator: " ", + scopes: "openid profile email phone address", + additionalQueryStringParams: {}, + useBasicAuthenticationWithAccessCodeGrant: false, + usePkceWithAuthorizationCodeGrant: false + }) +} diff --git a/dev-helpers/index.html b/dev-helpers/index.html index 5d3837c7a58..9432ef74ad0 100644 --- a/dev-helpers/index.html +++ b/dev-helpers/index.html @@ -5,65 +5,17 @@