diff --git a/.ci/packages/versions.env b/.ci/packages/versions.env index c4276920..bbba9899 100644 --- a/.ci/packages/versions.env +++ b/.ci/packages/versions.env @@ -11,4 +11,4 @@ export SWAGGER_VERSION=0.31.0 # github-releases/go-swagger/go-swagger&versioning export ZIG_VERSION=0.13.0 # github-releases/ziglang/zig&versioning=semver export MARKDOWN_LINK_CHECK_VERSION=3.12.2 # github-releases/tcort/markdown-link-check&versioning=semver export SYFT_VERSION=1.18.1 # github-releases/anchore/syft&versioning=semver -export OAPI_CODEGEN_VERSION=2.3.0 # github-releases/oapi-codegen/oapi-codegen&versioning=semver +export OAPI_CODEGEN_VERSION=2.4.1 # github-releases/oapi-codegen/oapi-codegen&versioning=semver diff --git a/generated/api/wfx.openapi.gen.go b/generated/api/wfx.openapi.gen.go index e5212047..5c1e7f93 100644 --- a/generated/api/wfx.openapi.gen.go +++ b/generated/api/wfx.openapi.gen.go @@ -2,7 +2,7 @@ // Package api provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. package api import ( @@ -3400,7 +3400,6 @@ type MiddlewareFunc func(http.Handler) http.Handler // GetHealth operation middleware func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetHealth(w, r) @@ -3410,12 +3409,11 @@ func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Requ handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // GetJobs operation middleware func (siw *ServerInterfaceWrapper) GetJobs(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -3515,12 +3513,11 @@ func (siw *ServerInterfaceWrapper) GetJobs(w http.ResponseWriter, r *http.Reques handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // PostJobs operation middleware func (siw *ServerInterfaceWrapper) PostJobs(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -3556,12 +3553,11 @@ func (siw *ServerInterfaceWrapper) PostJobs(w http.ResponseWriter, r *http.Reque handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // GetJobsEvents operation middleware func (siw *ServerInterfaceWrapper) GetJobsEvents(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -3608,12 +3604,11 @@ func (siw *ServerInterfaceWrapper) GetJobsEvents(w http.ResponseWriter, r *http. handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // DeleteJobsId operation middleware func (siw *ServerInterfaceWrapper) DeleteJobsId(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -3634,12 +3629,11 @@ func (siw *ServerInterfaceWrapper) DeleteJobsId(w http.ResponseWriter, r *http.R handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // GetJobsId operation middleware func (siw *ServerInterfaceWrapper) GetJobsId(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -3692,12 +3686,11 @@ func (siw *ServerInterfaceWrapper) GetJobsId(w http.ResponseWriter, r *http.Requ handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // GetJobsIdDefinition operation middleware func (siw *ServerInterfaceWrapper) GetJobsIdDefinition(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -3742,12 +3735,11 @@ func (siw *ServerInterfaceWrapper) GetJobsIdDefinition(w http.ResponseWriter, r handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // PutJobsIdDefinition operation middleware func (siw *ServerInterfaceWrapper) PutJobsIdDefinition(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -3792,12 +3784,11 @@ func (siw *ServerInterfaceWrapper) PutJobsIdDefinition(w http.ResponseWriter, r handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // GetJobsIdStatus operation middleware func (siw *ServerInterfaceWrapper) GetJobsIdStatus(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -3842,12 +3833,11 @@ func (siw *ServerInterfaceWrapper) GetJobsIdStatus(w http.ResponseWriter, r *htt handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // PutJobsIdStatus operation middleware func (siw *ServerInterfaceWrapper) PutJobsIdStatus(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -3892,12 +3882,11 @@ func (siw *ServerInterfaceWrapper) PutJobsIdStatus(w http.ResponseWriter, r *htt handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // DeleteJobsIdTags operation middleware func (siw *ServerInterfaceWrapper) DeleteJobsIdTags(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -3942,12 +3931,11 @@ func (siw *ServerInterfaceWrapper) DeleteJobsIdTags(w http.ResponseWriter, r *ht handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // GetJobsIdTags operation middleware func (siw *ServerInterfaceWrapper) GetJobsIdTags(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -3992,12 +3980,11 @@ func (siw *ServerInterfaceWrapper) GetJobsIdTags(w http.ResponseWriter, r *http. handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // PostJobsIdTags operation middleware func (siw *ServerInterfaceWrapper) PostJobsIdTags(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -4042,12 +4029,11 @@ func (siw *ServerInterfaceWrapper) PostJobsIdTags(w http.ResponseWriter, r *http handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // GetVersion operation middleware func (siw *ServerInterfaceWrapper) GetVersion(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetVersion(w, r) @@ -4057,12 +4043,11 @@ func (siw *ServerInterfaceWrapper) GetVersion(w http.ResponseWriter, r *http.Req handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // GetWorkflows operation middleware func (siw *ServerInterfaceWrapper) GetWorkflows(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -4122,12 +4107,11 @@ func (siw *ServerInterfaceWrapper) GetWorkflows(w http.ResponseWriter, r *http.R handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // PostWorkflows operation middleware func (siw *ServerInterfaceWrapper) PostWorkflows(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -4163,12 +4147,11 @@ func (siw *ServerInterfaceWrapper) PostWorkflows(w http.ResponseWriter, r *http. handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // DeleteWorkflowsName operation middleware func (siw *ServerInterfaceWrapper) DeleteWorkflowsName(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -4189,12 +4172,11 @@ func (siw *ServerInterfaceWrapper) DeleteWorkflowsName(w http.ResponseWriter, r handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } // GetWorkflowsName operation middleware func (siw *ServerInterfaceWrapper) GetWorkflowsName(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var err error @@ -4239,7 +4221,7 @@ func (siw *ServerInterfaceWrapper) GetWorkflowsName(w http.ResponseWriter, r *ht handler = middleware(handler) } - handler.ServeHTTP(w, r.WithContext(ctx)) + handler.ServeHTTP(w, r) } type UnescapedCookieParamError struct { @@ -4316,21 +4298,27 @@ func Handler(si ServerInterface) http.Handler { return HandlerWithOptions(si, StdHTTPServerOptions{}) } +// ServeMux is an abstraction of http.ServeMux. +type ServeMux interface { + HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) + ServeHTTP(w http.ResponseWriter, r *http.Request) +} + type StdHTTPServerOptions struct { BaseURL string - BaseRouter *http.ServeMux + BaseRouter ServeMux Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) } // HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux. -func HandlerFromMux(si ServerInterface, m *http.ServeMux) http.Handler { +func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler { return HandlerWithOptions(si, StdHTTPServerOptions{ BaseRouter: m, }) } -func HandlerFromMuxWithBaseURL(si ServerInterface, m *http.ServeMux, baseURL string) http.Handler { +func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler { return HandlerWithOptions(si, StdHTTPServerOptions{ BaseURL: baseURL, BaseRouter: m,