- Download swagger-ui-dist@5.32.0 and embed swagger-ui-bundle.js and swagger-ui.css into web/static/ so they are served from the same origin - Update docs.html to reference /static/ paths instead of unpkg.com CDN URLs - Add GET /static/swagger-ui-bundle.js and GET /static/swagger-ui.css handlers serving the embedded bytes with correct Content-Type headers - Fixes /docs breakage caused by CSP default-src 'self' blocking external CDN scripts and stylesheets Co-authored-by: Junie <junie@jetbrains.com>
24 lines
597 B
HTML
24 lines
597 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>MCIAS API Reference</title>
|
|
<link rel="stylesheet" href="/static/swagger-ui.css">
|
|
</head>
|
|
<body>
|
|
<div id="swagger-ui"></div>
|
|
<script src="/static/swagger-ui-bundle.js"></script>
|
|
<script>
|
|
SwaggerUIBundle({
|
|
url: "/docs/openapi.yaml",
|
|
dom_id: "#swagger-ui",
|
|
presets: [SwaggerUIBundle.presets.apis, SwaggerUIBundle.SwaggerUIStandalonePreset],
|
|
layout: "BaseLayout",
|
|
deepLinking: true,
|
|
persistAuthorization: true,
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|