diff --git a/swagger.go b/swagger.go index e4e5de7..b1153e2 100644 --- a/swagger.go +++ b/swagger.go @@ -270,7 +270,7 @@ window.onload = function() { url: "{{.URL}}", deepLinking: {{.DeepLinking}}, docExpansion: "{{.DocExpansion}}", - dom_id: "{{.DomID}}", + dom_id: "#{{.DomID}}", persistAuthorization: {{.PersistAuthorization}}, validatorUrl: null, presets: [ diff --git a/swagger_test.go b/swagger_test.go index c59af75..ab72ca2 100644 --- a/swagger_test.go +++ b/swagger_test.go @@ -335,7 +335,7 @@ func TestUIConfigOptions(t *testing.T) { URL: "doc.json", DeepLinking: true, DocExpansion: "list", - DomID: "#swagger-ui", + DomID: "swagger-ui", PersistAuthorization: false, }, exp: `window.onload = function() { @@ -367,7 +367,7 @@ func TestUIConfigOptions(t *testing.T) { DeepLinking: false, PersistAuthorization: true, DocExpansion: "none", - DomID: "#swagger-ui-id", + DomID: "swagger-ui-id", BeforeScript: `const SomePlugin = (system) => ({ // Some plugin });