Skip to content

Commit 61e3e4f

Browse files
committed
giving up on Redoc and switching to swagger
1 parent 0e4698e commit 61e3e4f

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

docs/index.html

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<title>API Documentation</title>
6-
<meta name="viewport" content="width=device-width, initial-scale=1" />
7-
<style>
8-
body {
9-
margin: 0;
10-
padding: 0;
11-
}
12-
redoc {
13-
display: block;
14-
height: 100vh;
15-
}
16-
</style>
17-
</head>
18-
<body>
19-
<redoc spec-url="APISpecification.yaml"></redoc>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>API Documentation</title>
6+
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist/swagger-ui.css" />
7+
<style>
8+
body { margin: 0; padding: 0; }
9+
</style>
10+
</head>
11+
<body>
12+
<div id="swagger-ui"></div>
2013

21-
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"></script>
22-
</body>
14+
<script src="https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"></script>
15+
<script src="https://unpkg.com/swagger-ui-dist/swagger-ui-standalone-preset.js"></script>
16+
<script>
17+
window.onload = () => {
18+
SwaggerUIBundle({
19+
url: "APISpecification.yaml", // IMPORTANT: relative path
20+
dom_id: '#swagger-ui',
21+
presets: [
22+
SwaggerUIBundle.presets.apis,
23+
SwaggerUIStandalonePreset
24+
],
25+
layout: "StandaloneLayout"
26+
});
27+
};
28+
</script>
29+
</body>
2330
</html>

0 commit comments

Comments
 (0)