Skip to content

Commit 8b92bbd

Browse files
committed
MINOR: spec: remove deprecated calls for spec and UI handlers
1 parent ddd2aa1 commit 8b92bbd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

adapters/adapters.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"strconv"
2323
"strings"
2424

25-
openapi_middleware "github.com/go-openapi/runtime/middleware"
25+
"github.com/go-openapi/runtime/server-middleware/docui"
2626
clientnative "github.com/haproxytech/client-native/v6"
2727
cn_configuration "github.com/haproxytech/client-native/v6/configuration"
2828
"github.com/haproxytech/client-native/v6/models"
@@ -230,8 +230,8 @@ func MaxBodySizeMiddleware(maxSize int64) Adapter {
230230
// behavior of the previous go-swagger server. All other requests pass through.
231231
func SpecDocsMiddleware(swaggerJSON []byte, basePath, title string) Adapter {
232232
return func(h http.Handler) http.Handler {
233-
return openapi_middleware.Spec("", swaggerJSON,
234-
openapi_middleware.Redoc(openapi_middleware.RedocOpts{BasePath: basePath, Title: title}, h))
233+
return docui.ServeSpec(swaggerJSON,
234+
docui.Redoc(h, docui.WithUIBasePath(basePath), docui.WithUITitle(title)))
235235
}
236236
}
237237

0 commit comments

Comments
 (0)