func (sr *OpenAPIMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	if sr.handler == nil {
		sr.handler = chain(sr.middlewares, http.HandlerFunc(sr.handleRequest))
	}
	sr.handler.ServeHTTP(w, r)
}
ServeHTTP is the single method of the http.Handler interface that makes
swagger router interoperable with the standard library.
It will run request through all regestered middlewares and finally
pass to handler.
package openapimux
import (
	"context"
	"net/http"
	"github.com/getkin/kin-openapi/openapi3"
	"github.com/getkin/kin-openapi/openapi3filter"
	legacyrouter "github.com/getkin/kin-openapi/routers/legacy"
)
type OpenAPIMux struct {
	handler       http.Handler
	handlers      map[string]http.Handler
	middlewares   []func(http.Handler) http.Handler
	Routers       *legacyrouter.Routers
	ErrorHandler  func(http.ResponseWriter, *http.Request, string, int)
	DetailedError bool
}
type contextKey struct {
	name string
}
var pathParamsKey = &contextKey{"pathParams"}
func NewRouter(apis ...string) (*OpenAPIMux, error) {
	routers := make(legacyrouter.Routers, len(apis))
	for i, api := range apis {
		swagger, e := openapi3.NewLoader().LoadFromFile(api)
		if e != nil {
			return nil, e
		}
		route, e := legacyrouter.NewRouter(swagger)
		routers[i] = route.(*legacyrouter.Router)
	}
	return &OpenAPIMux{
		Routers:       &routers,
		ErrorHandler:  Respond,
		DetailedError: true,
	}, nil
}