Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/server/openapi_ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func OpenAPIUIHandler(_ string) http.Handler {
<title>OCAP2 Web API</title>
</head>
<body>
<script id="api-reference" data-url="swagger/openapi.json" data-configuration='{"darkMode":true,"showDeveloperTools":"never"}'></script>
<script id="api-reference" data-url="openapi.json" data-configuration='{"darkMode":true,"showDeveloperTools":"never"}'></script>
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
</body>
</html>`
Expand Down
2 changes: 1 addition & 1 deletion internal/server/openapi_ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestOpenAPIUIHandler(t *testing.T) {
assert.Equal(t, "text/html; charset=utf-8", rec.Header().Get("Content-Type"))

body := rec.Body.String()
assert.Contains(t, body, `data-url="swagger/openapi.json"`, "should use relative spec URL")
assert.Contains(t, body, `data-url="openapi.json"`, "should use relative spec URL")
assert.NotContains(t, body, "/ignored/absolute/path", "should not use absolute spec URL")
assert.Contains(t, body, `"darkMode":true`, "should enable dark mode")
assert.Contains(t, body, "OCAP2 Web API", "should have the page title")
Expand Down
Loading