-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for custom Swagger/ReDoc UI files URLs
* Add support for custom Swagger UI files URL sources * refactor: expose cdn opts - added tests * Fix test assertion * Apply corrections before merge - Do not assume that URLs are for CDNs - Remove the connection between OpenAPIHandler and class with files URLs * Restore contribution for PR #423 * Update CHANGELOG.md * Update CHANGELOG.md * Update __init__.py --------- Co-authored-by: benefactarch <[email protected]>
- Loading branch information
1 parent
4c74ee5
commit 1a4ca42
Showing
8 changed files
with
211 additions
and
56 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
used types to reduce the verbosity of the imports statements. | ||
""" | ||
__author__ = "Roberto Prevato <[email protected]>" | ||
__version__ = "2.0.1" | ||
__version__ = "2.0.2" | ||
|
||
from .contents import Content as Content | ||
from .contents import FormContent as FormContent | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<head> | ||
<title>##PAGE_TITLE##</title> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="icon" href="/favicon.png" /> | ||
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css"> | ||
</head> | ||
<body> | ||
<link type="text/css" rel="stylesheet" href="##CSS_URL##" /> | ||
</head> | ||
<body> | ||
<div id="swagger-ui"></div> | ||
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js"></script> | ||
<script src="##JS_URL##"></script> | ||
<script> | ||
const ui = SwaggerUIBundle({ | ||
url: '##SPEC_URL##', | ||
oauth2RedirectUrl: window.location.origin + '/docs/oauth2-redirect', | ||
dom_id: '#swagger-ui', | ||
presets: [ | ||
SwaggerUIBundle.presets.apis, | ||
SwaggerUIBundle.SwaggerUIStandalonePreset | ||
], | ||
layout: "BaseLayout", | ||
deepLinking: true, | ||
showExtensions: true, | ||
showCommonExtensions: true | ||
}) | ||
const ui = SwaggerUIBundle({ | ||
url: "##SPEC_URL##", | ||
oauth2RedirectUrl: window.location.origin + "/docs/oauth2-redirect", | ||
dom_id: "#swagger-ui", | ||
presets: [ | ||
SwaggerUIBundle.presets.apis, | ||
SwaggerUIBundle.SwaggerUIStandalonePreset | ||
], | ||
layout: "BaseLayout", | ||
deepLinking: true, | ||
showExtensions: true, | ||
showCommonExtensions: true | ||
}); | ||
</script> | ||
</body> | ||
</body> | ||
</html> |
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
Oops, something went wrong.