-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change method of serving documentation from auto-generated to static …
…(but reads auto-generated info)
- Loading branch information
Showing
11 changed files
with
98 additions
and
46 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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="description" content="SwaggerUI" /> | ||
<title>SwaggerUI</title> | ||
<link href="/${base}/css/swagger-ui.css" rel="stylesheet"> | ||
<script src="/${base}/js/jquery.min.js"></script> | ||
</head> | ||
<body> | ||
<div id="swagger-ui"></div> | ||
<script src="/${base}/js/swagger-ui-bundle.js"></script> | ||
<script> | ||
window.onload = () => { | ||
$.getJSON('/${base}/v2/api-docs', function(data) { | ||
//under the "paths" property, we have all the endpoints. | ||
//loop through and change anywhere we find "/rest/cws-ui/api/" to "/cws-ui/rest/" | ||
//also, add the securityDefinitions property | ||
for (var path in data.paths) { | ||
var newPath = path.replace("/rest/cws-ui/api/", "/cws-ui/rest/"); | ||
data.paths[newPath] = data.paths[path]; | ||
delete data.paths[path]; | ||
} | ||
data["securityDefinitions"] = { | ||
"cwsToken": { | ||
"type": "apiKey", | ||
"name": "cwsToken", | ||
"in": "header" | ||
} | ||
}; | ||
data["security"] = [ | ||
{ | ||
"cwsToken": [] | ||
} | ||
]; | ||
delete data.tags; | ||
window.ui = SwaggerUIBundle({ | ||
spec: data, | ||
dom_id: '#swagger-ui', | ||
deepLinking: true, | ||
docExpansion: 'none', | ||
}); | ||
}); | ||
}; | ||
</script> | ||
</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