Skip to content
Open
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 current_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v4.14.3
v5.16.2
2 changes: 1 addition & 1 deletion embed/swagger-initializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ window.onload = function() {

// the following lines will be replaced by docker/configurator, when it runs in a docker-container
window.ui = SwaggerUIBundle({
url: "./swagger_spec",
url: "./swagger.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
Expand Down
2 changes: 1 addition & 1 deletion embed/swagger-ui-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion embed/swagger-ui-bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion embed/swagger-ui-es-bundle-core.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion embed/swagger-ui-es-bundle-core.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion embed/swagger-ui-es-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion embed/swagger-ui-es-bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion embed/swagger-ui-standalone-preset.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion embed/swagger-ui-standalone-preset.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion embed/swagger-ui.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion embed/swagger-ui.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion embed/swagger-ui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion embed/swagger-ui.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions generate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This program downloads the dist assets for the current swagger-ui version and places them into the embed directory
// TODO: Compress?

//go:build ignore
// +build ignore

package main
Expand Down Expand Up @@ -119,10 +120,10 @@ func main() {
//newInit := strings.Replace(
//string(initFile),
//`url: "https://petstore.swagger.io/v2/swagger.json"`,
//`url: "./swagger_spec"`,
//`url: "./swagger.json"`,
//-1,
//)
newInit := regexp.MustCompile(`url:\s+"[^"]*"`).ReplaceAllLiteral(initFile, []byte(`url: "./swagger_spec"`))
newInit := regexp.MustCompile(`url:\s+"[^"]*"`).ReplaceAllLiteral(initFile, []byte(`url: "./swagger.json"`))
newInit = regexp.MustCompile(`,?\s+SwaggerUIStandalonePreset.*\n`).ReplaceAllLiteral(newInit, []byte("\n"))
newInit = regexp.MustCompile(`(?s),\s+plugins: \[.*],\n`).ReplaceAllLiteral(newInit, []byte("\n"))
newInit = regexp.MustCompile(`\n\s*layout:.*\n`).ReplaceAllLiteral(newInit, []byte("\n"))
Expand Down
2 changes: 1 addition & 1 deletion swaggerui.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func Handler(spec []byte) http.Handler {
// render the index template with the proper spec name inserted
static, _ := fs.Sub(swagfs, "embed")
mux := http.NewServeMux()
mux.HandleFunc("/swagger_spec", byteHandler(spec))
mux.HandleFunc("/swagger.json", byteHandler(spec))
mux.Handle("/", http.FileServer(http.FS(static)))
return mux
}