Created
March 27, 2021 11:20
-
-
Save jellehak/6afd47367b3d09777b5f079b14a182b3 to your computer and use it in GitHub Desktop.
Swagger CDN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Docs</title> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/swagger-ui.css"> | |
</head> | |
<body> | |
<div id="ui-wrapper-new" data-spec="{{spec}}"> | |
Loading.... | |
</div> | |
</body> | |
<script src="https://unpkg.com/[email protected]/swagger-ui-bundle.js"></script> | |
<script> | |
var swaggerUIOptions = { | |
url: "https://petstore.swagger.io/v2/swagger.json", | |
dom_id: '#ui-wrapper-new', // Determine what element to load swagger ui | |
docExpansion: 'list', | |
deepLinking: true, // Enables dynamic deep linking for tags and operations | |
filter: true, | |
presets: [ | |
SwaggerUIBundle.presets.apis, | |
SwaggerUIBundle.SwaggerUIStandalonePreset | |
], | |
plugins: [ | |
SwaggerUIBundle.plugins.DownloadUrl | |
], | |
} | |
var ui = SwaggerUIBundle(swaggerUIOptions) | |
/** Export to window for use in custom js */ | |
window.ui = ui | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please use
@latest