From 067ed38cefca87249cb593548dcd4ed3ba25656e Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 19 Dec 2024 23:08:12 +0100 Subject: [PATCH] remove swagger in v1 (see #23020 for v2) --- server/swagger.go | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 server/swagger.go diff --git a/server/swagger.go b/server/swagger.go deleted file mode 100644 index c491fa7c338d..000000000000 --- a/server/swagger.go +++ /dev/null @@ -1,28 +0,0 @@ -package server - -import ( - "io/fs" - "net/http" - - "github.com/gorilla/mux" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/docs" -) - -// RegisterSwaggerAPI provides a common function which registers swagger route with API Server -func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router, swaggerEnabled bool) error { - if !swaggerEnabled { - return nil - } - - root, err := fs.Sub(docs.SwaggerUI, "swagger-ui") - if err != nil { - return err - } - - staticServer := http.FileServer(http.FS(root)) - rtr.PathPrefix("/swagger/").Handler(http.StripPrefix("/swagger/", staticServer)) - - return nil -}