Files
swagger-ui/dev-helpers/index.html
Kyle Shockey 345c8dee57 WIP
2017-11-01 13:30:07 -07:00

4.0 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"> </script> <script src="./swagger-ui-standalone-preset.js"> </script> <script> const MyComponentPlugin = function(system) { return { components: { // components can just be functions // HelloWorld: () => "Hello World" } } } window.onload = function() { window["SwaggerUIBundle"] = window["swagger-ui-bundle"] window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"] // Build a system const ui = SwaggerUIBundle({ url: "http://petstore.swagger.io/v2/swagger.json", dom_id: '#swagger-ui', presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ], plugins: [ SwaggerUIBundle.plugins.DownloadUrl, MyComponentPlugin ], 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: " ", additionalQueryStringParams: {} }) } </script> </html>