diff --git a/src/autodoc.jl b/src/autodoc.jl index 295372ee..378224b6 100644 --- a/src/autodoc.jl +++ b/src/autodoc.jl @@ -339,7 +339,7 @@ function readstaticfile(filepath::String) :: String return read(path, String) end -function redochtml(schemapath::String) :: HTTP.Response +function redochtml(schemapath::String, docspath::String) :: HTTP.Response redocjs = readstaticfile("$REDOC_VERSION/redoc.standalone.js") html(""" @@ -351,7 +351,7 @@ function redochtml(schemapath::String) :: HTTP.Response - + @@ -366,7 +366,7 @@ end """ Return HTML page to render the autogenerated docs """ -function swaggerhtml(schemapath::String; docspath::String = "/docs") :: HTTP.Response +function swaggerhtml(schemapath::String, docspath::String) :: HTTP.Response # load static content files swaggerjs = readstaticfile("$SWAGGER_VERSION/swagger-ui-bundle.js") diff --git a/src/core.jl b/src/core.jl index 2645f7e8..15a0e959 100644 --- a/src/core.jl +++ b/src/core.jl @@ -551,9 +551,9 @@ end # add the swagger and swagger/schema routes function setupdocs(router::Router, schema::Dict, docspath::String, schemapath::String) full_schema = "$docspath$schemapath" - register(router, "GET", "$docspath", () -> swaggerhtml(full_schema, docspath = docspath)) - register(router, "GET", "$docspath/swagger", () -> swaggerhtml(full_schema, docspath = docspath)) - register(router, "GET", "$docspath/redoc", () -> redochtml(full_schema)) + register(router, "GET", "$docspath", () -> swaggerhtml(full_schema, docspath)) + register(router, "GET", "$docspath/swagger", () -> swaggerhtml(full_schema, docspath)) + register(router, "GET", "$docspath/redoc", () -> redochtml(full_schema, docspath)) register(router, "GET", full_schema, () -> schema) end