feat(swagger): add Swagger UI for API documentation
Some checks failed
CI / Test (1.23) (push) Failing after -20m40s
CI / Test (1.22) (push) Failing after -20m58s
CI / Build (push) Failing after -21m33s
CI / Lint (push) Failing after -20m51s

* Create index.html for Swagger UI integration
* Link to Swagger UI CSS and JS from CDN
* Configure Swagger UI to load API specification from api.json
This commit is contained in:
Hein
2026-02-20 17:41:20 +02:00
parent 5b3aaba198
commit a3ff2dc497
7 changed files with 3516 additions and 319 deletions

1704
web/public/api.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WhatsHooked API</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css" />
<style>
body { margin: 0; }
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js"></script>
<script>
SwaggerUIBundle({
url: "../api.json",
dom_id: "#swagger-ui",
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset,
],
layout: "BaseLayout",
deepLinking: true,
tryItOutEnabled: true,
});
</script>
</body>
</html>