fix: move Swagger init to external JS (CSP compliance)

This commit is contained in:
OpenClaw 2026-02-14 22:27:15 +00:00
parent d859e9fa60
commit 5f10977705
2 changed files with 19 additions and 20 deletions

18
public/swagger-init.js Normal file
View file

@ -0,0 +1,18 @@
SwaggerUIBundle({
url: "/openapi.json",
dom_id: "#swagger-ui",
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
],
layout: "BaseLayout",
defaultModelsExpandDepth: 1,
defaultModelExpandDepth: 2,
docExpansion: "list",
filter: true,
tryItOutEnabled: true,
requestSnippetsEnabled: true,
persistAuthorization: true,
syntaxHighlight: { theme: "monokai" }
});