diff --git a/.golangci.yml b/.golangci.yml index 7fe7ef5c2..3a524ddf8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,3 +1,3 @@ issues: exclude: - - '.*This has been replaced by github.com/oapi-codegen/runtime.*' + - '.*This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime.*' diff --git a/pkg/chi-middleware/oapi_validate.go b/pkg/chi-middleware/oapi_validate.go index 91e4d1b61..075e0b12a 100644 --- a/pkg/chi-middleware/oapi_validate.go +++ b/pkg/chi-middleware/oapi_validate.go @@ -18,17 +18,17 @@ import ( // ErrorHandler is called when there is an error in validation // -// Deprecated: This has been replaced by github.com/oapi-codegen/nethttp-middleware#ErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/nethttp-middleware#ErrorHandler type ErrorHandler func(w http.ResponseWriter, message string, statusCode int) // MultiErrorHandler is called when oapi returns a MultiError type // -// Deprecated: This has been replaced by github.com/oapi-codegen/nethttp-middleware# +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/nethttp-middleware#MultiErrorHandler type MultiErrorHandler func(openapi3.MultiError) (int, error) // Options to customize request validation, openapi3filter specified options will be passed through. // -// Deprecated: This has been replaced by github.com/oapi-codegen/nethttp-middleware#Options +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/nethttp-middleware#Options type Options struct { Options openapi3filter.Options ErrorHandler ErrorHandler @@ -40,7 +40,7 @@ type Options struct { // OapiRequestValidator Creates middleware to validate request by swagger spec. // This middleware is good for net/http either since go-chi is 100% compatible with net/http. // -// Deprecated: This has been replaced by github.com/oapi-codegen/nethttp-middleware#OapiRequestValidator +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/nethttp-middleware#OapiRequestValidator func OapiRequestValidator(swagger *openapi3.T) func(next http.Handler) http.Handler { return OapiRequestValidatorWithOptions(swagger, nil) } @@ -48,7 +48,7 @@ func OapiRequestValidator(swagger *openapi3.T) func(next http.Handler) http.Hand // OapiRequestValidatorWithOptions Creates middleware to validate request by swagger spec. // This middleware is good for net/http either since go-chi is 100% compatible with net/http. // -// Deprecated: This has been replaced by github.com/oapi-codegen/nethttp-middleware#OapiRequestValidatorWithOptions +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/nethttp-middleware#OapiRequestValidatorWithOptions func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) func(next http.Handler) http.Handler { if swagger.Servers != nil && (options == nil || !options.SilenceServersWarning) { log.Println("WARN: OapiRequestValidatorWithOptions called with an OpenAPI spec that has `Servers` set. This may lead to an HTTP 400 with `no matching operation was found` when sending a valid request, as the validator performs `Host` header validation. If you're expecting `Host` header validation, you can silence this warning by setting `Options.SilenceServersWarning = true`. See https://github.com/deepmap/oapi-codegen/issues/882 for more information.") @@ -82,7 +82,7 @@ func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) func // validateRequest is called from the middleware above and actually does the work // of validating a request. // -// Deprecated: This has been replaced by github.com/oapi-codegen/nethttp-middleware#validateRequest +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/nethttp-middleware#validateRequest func validateRequest(r *http.Request, router routers.Router, options *Options) (int, error) { // Find route @@ -131,7 +131,7 @@ func validateRequest(r *http.Request, router routers.Router, options *Options) ( // attempt to get the MultiErrorHandler from the options. If it is not set, // return a default handler // -// Deprecated: This has been replaced by github.com/oapi-codegen/nethttp-middleware#getMultiErrorHandlerFromOptions +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/nethttp-middleware#getMultiErrorHandlerFromOptions func getMultiErrorHandlerFromOptions(options *Options) MultiErrorHandler { if options == nil { return defaultMultiErrorHandler @@ -148,7 +148,7 @@ func getMultiErrorHandlerFromOptions(options *Options) MultiErrorHandler { // of all the errors. This method is called if there are no other // methods defined on the options. // -// Deprecated: This has been replaced by github.com/oapi-codegen/nethttp-middleware#defaultMultiErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/nethttp-middleware#defaultMultiErrorHandler func defaultMultiErrorHandler(me openapi3.MultiError) (int, error) { return http.StatusBadRequest, me } diff --git a/pkg/fiber-middleware/oapi_validate.go b/pkg/fiber-middleware/oapi_validate.go index ee7e21910..a142c6d68 100644 --- a/pkg/fiber-middleware/oapi_validate.go +++ b/pkg/fiber-middleware/oapi_validate.go @@ -24,7 +24,7 @@ type ctxKeyUserData struct{} // OapiValidatorFromYamlFile creates a validator middleware from a YAML file path // -// Deprecated: This has been replaced by github.com/oapi-codegen/fiber-middleware#OapiValidatorFromYamlFile +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#OapiValidatorFromYamlFile func OapiValidatorFromYamlFile(path string) (fiber.Handler, error) { data, err := os.ReadFile(path) @@ -45,25 +45,25 @@ func OapiValidatorFromYamlFile(path string) (fiber.Handler, error) { // to make sure that they conform to the given OAPI 3.0 specification. When // OAPI validation fails on the request, we return an HTTP/400 with error message // -// Deprecated: This has been replaced by github.com/oapi-codegen/fiber-middleware#OapiRequestValidator +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#OapiRequestValidator func OapiRequestValidator(swagger *openapi3.T) fiber.Handler { return OapiRequestValidatorWithOptions(swagger, nil) } // ErrorHandler is called when there is an error in validation // -// Deprecated: This has been replaced by github.com/oapi-codegen/fiber-middleware#ErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#ErrorHandler type ErrorHandler func(c *fiber.Ctx, message string, statusCode int) // MultiErrorHandler is called when oapi returns a MultiError type // -// Deprecated: This has been replaced by github.com/oapi-codegen/fiber-middleware#MultiErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#MultiErrorHandler type MultiErrorHandler func(openapi3.MultiError) error // Options to customize request validation. These are passed through to // openapi3filter. // -// Deprecated: This has been replaced by github.com/oapi-codegen/fiber-middleware#Options +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#Options type Options struct { Options openapi3filter.Options ErrorHandler ErrorHandler @@ -74,7 +74,7 @@ type Options struct { // OapiRequestValidatorWithOptions creates a validator from a swagger object, with validation options // -// Deprecated: This has been replaced by github.com/oapi-codegen/fiber-middleware#OapiRequestValidatorWithOptions +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#OapiRequestValidatorWithOptions func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) fiber.Handler { router, err := gorillamux.NewRouter(swagger) @@ -102,7 +102,7 @@ func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) fibe // ValidateRequestFromContext is called from the middleware above and actually does the work // of validating a request. // -// Deprecated: This has been replaced by github.com/oapi-codegen/fiber-middleware# +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#ValidateRequestFromContext func ValidateRequestFromContext(c *fiber.Ctx, router routers.Router, options *Options) error { r, err := adaptor.ConvertRequest(c, false) @@ -172,7 +172,7 @@ func ValidateRequestFromContext(c *fiber.Ctx, router routers.Router, options *Op // GetFiberContext gets the fiber context from within requests. It returns // nil if not found or wrong type. // -// Deprecated: This has been replaced by github.com/oapi-codegen/fiber-middleware#GetFiberContext +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#GetFiberContext func GetFiberContext(c context.Context) *fiber.Ctx { iface := c.Value(ctxKeyFiberContext{}) if iface == nil { @@ -186,7 +186,7 @@ func GetFiberContext(c context.Context) *fiber.Ctx { return nil } -// Deprecated: This has been replaced by github.com/oapi-codegen/fiber-middleware#GetUserData +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#GetUserData func GetUserData(c context.Context) interface{} { return c.Value(ctxKeyUserData{}) } @@ -194,7 +194,7 @@ func GetUserData(c context.Context) interface{} { // getMultiErrorHandlerFromOptions attempts to get the MultiErrorHandler from the options. If it is not set, // return a default handler // -// Deprecated: This has been replaced by github.com/oapi-codegen/fiber-middleware#getMultiErrorHandlerFromOptions +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#getMultiErrorHandlerFromOptions func getMultiErrorHandlerFromOptions(options *Options) MultiErrorHandler { if options == nil { return defaultMultiErrorHandler @@ -210,7 +210,7 @@ func getMultiErrorHandlerFromOptions(options *Options) MultiErrorHandler { // defaultMultiErrorHandler returns a StatusBadRequest (400) and a list // of all the errors. This method is called if there are no other // methods defined on the options. -// Deprecated: This has been replaced by github.com/oapi-codegen/fiber-middleware#defaultMultiErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#defaultMultiErrorHandler func defaultMultiErrorHandler(me openapi3.MultiError) error { return fmt.Errorf("multiple errors encountered: %s", me) } diff --git a/pkg/gin-middleware/oapi_validate.go b/pkg/gin-middleware/oapi_validate.go index 86b1c3a62..bca99d2af 100644 --- a/pkg/gin-middleware/oapi_validate.go +++ b/pkg/gin-middleware/oapi_validate.go @@ -37,7 +37,7 @@ const ( // OapiValidatorFromYamlFile creates a validator middleware from a YAML file path // -// Deprecated: This has been replaced by github.com/oapi-codegen/gin-middleware#OapiValidatorFromYamlFile +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#OapiValidatorFromYamlFile func OapiValidatorFromYamlFile(path string) (gin.HandlerFunc, error) { data, err := os.ReadFile(path) if err != nil { @@ -56,25 +56,25 @@ func OapiValidatorFromYamlFile(path string) (gin.HandlerFunc, error) { // to make sure that they conform to the given OAPI 3.0 specification. When // OAPI validation fails on the request, we return an HTTP/400 with error message // -// Deprecated: This has been replaced by github.com/oapi-codegen/gin-middleware#OapiRequestValidator +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#OapiRequestValidator func OapiRequestValidator(swagger *openapi3.T) gin.HandlerFunc { return OapiRequestValidatorWithOptions(swagger, nil) } // ErrorHandler is called when there is an error in validation // -// Deprecated: This has been replaced by github.com/oapi-codegen/gin-middleware#ErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#ErrorHandler type ErrorHandler func(c *gin.Context, message string, statusCode int) // MultiErrorHandler is called when oapi returns a MultiError type // -// Deprecated: This has been replaced by github.com/oapi-codegen/gin-middleware#MultiErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#MultiErrorHandler type MultiErrorHandler func(openapi3.MultiError) error // Options to customize request validation. These are passed through to // openapi3filter. // -// Deprecated: This has been replaced by github.com/oapi-codegen/gin-middleware#Options +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#Options type Options struct { ErrorHandler ErrorHandler Options openapi3filter.Options @@ -87,7 +87,7 @@ type Options struct { // OapiRequestValidatorWithOptions creates a validator from a swagger object, with validation options // -// Deprecated: This has been replaced by github.com/oapi-codegen/gin-middleware#OapiRequestValidatorWithOptions +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#OapiRequestValidatorWithOptions func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) gin.HandlerFunc { if swagger.Servers != nil && (options == nil || !options.SilenceServersWarning) { log.Println("WARN: OapiRequestValidatorWithOptions called with an OpenAPI spec that has `Servers` set. This may lead to an HTTP 400 with `no matching operation was found` when sending a valid request, as the validator performs `Host` header validation. If you're expecting `Host` header validation, you can silence this warning by setting `Options.SilenceServersWarning = true`. See https://github.com/deepmap/oapi-codegen/issues/882 for more information.") @@ -124,7 +124,7 @@ func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) gin. // ValidateRequestFromContext is called from the middleware above and actually does the work // of validating a request. // -// Deprecated: This has been replaced by github.com/oapi-codegen/gin-middleware#ValidateRequestFromContext +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#ValidateRequestFromContext func ValidateRequestFromContext(c *gin.Context, router routers.Router, options *Options) error { req := c.Request route, pathParams, err := router.FindRoute(req) @@ -188,7 +188,7 @@ func ValidateRequestFromContext(c *gin.Context, router routers.Router, options * // GetGinContext gets the echo context from within requests. It returns // nil if not found or wrong type. // -// Deprecated: This has been replaced by github.com/oapi-codegen/gin-middleware#GetGinContext +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#GetGinContext func GetGinContext(c context.Context) *gin.Context { iface := c.Value(GinContextKey) if iface == nil { @@ -208,7 +208,7 @@ func GetUserData(c context.Context) interface{} { // attempt to get the MultiErrorHandler from the options. If it is not set, // return a default handler // -// Deprecated: This has been replaced by github.com/oapi-codegen/gin-middleware#getMultiErrorHandlerFromOptions +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#getMultiErrorHandlerFromOptions func getMultiErrorHandlerFromOptions(options *Options) MultiErrorHandler { if options == nil { return defaultMultiErrorHandler @@ -225,7 +225,7 @@ func getMultiErrorHandlerFromOptions(options *Options) MultiErrorHandler { // of all of the errors. This method is called if there are no other // methods defined on the options. // -// Deprecated: This has been replaced by github.com/oapi-codegen/gin-middleware#defaultMultiErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#defaultMultiErrorHandler func defaultMultiErrorHandler(me openapi3.MultiError) error { return fmt.Errorf("multiple errors encountered: %s", me) } diff --git a/pkg/iris-middleware/oapi_validate.go b/pkg/iris-middleware/oapi_validate.go index 5b0c1a739..5c791451c 100644 --- a/pkg/iris-middleware/oapi_validate.go +++ b/pkg/iris-middleware/oapi_validate.go @@ -22,7 +22,7 @@ const ( // OapiValidatorFromYamlFile creates a validator middleware from a YAML file path // -// Deprecated: This has been replaced by github.com/oapi-codegen/iris-middleware#OapiValidatorFromYamlFile +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/iris-middleware#OapiValidatorFromYamlFile func OapiValidatorFromYamlFile(path string) (iris.Handler, error) { data, err := os.ReadFile(path) if err != nil { @@ -42,25 +42,25 @@ func OapiValidatorFromYamlFile(path string) (iris.Handler, error) { // to make sure that they conform to the given OAPI 3.0 specification. When // OAPI validation fails on the request, we return an HTTP/400 with error message // -// Deprecated: This has been replaced by github.com/oapi-codegen/iris-middleware#OapiRequestValidator +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/iris-middleware#OapiRequestValidator func OapiRequestValidator(swagger *openapi3.T) iris.Handler { return OapiRequestValidatorWithOptions(swagger, nil) } // ErrorHandler is called when there is an error in validation // -// Deprecated: This has been replaced by github.com/oapi-codegen/iris-middleware#ErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/iris-middleware#ErrorHandler type ErrorHandler func(ctx iris.Context, message string, statusCode int) // MultiErrorHandler is called when oapi returns a MultiError type // -// Deprecated: This has been replaced by github.com/oapi-codegen/iris-middleware#MultiErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/iris-middleware#MultiErrorHandler type MultiErrorHandler func(openapi3.MultiError) error // Options to customize request validation. These are passed through to // openapi3filter. // -// Deprecated: This has been replaced by github.com/oapi-codegen/iris-middleware#Options +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/iris-middleware#Options type Options struct { Options openapi3filter.Options ErrorHandler ErrorHandler @@ -73,7 +73,7 @@ type Options struct { // OapiRequestValidatorWithOptions creates a validator from a swagger object, with validation options // -// Deprecated: This has been replaced by github.com/oapi-codegen/iris-middleware#OapiRequestValidatorWithOptions +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/iris-middleware#OapiRequestValidatorWithOptions func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) iris.Handler { router, err := gorillamux.NewRouter(swagger) if err != nil { @@ -96,7 +96,7 @@ func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) iris // ValidateRequestFromContext is called from the middleware above and actually does the work // of validating a request. // -// Deprecated: This has been replaced by github.com/oapi-codegen/iris-middleware#ValidateRequestFromContext +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/iris-middleware#ValidateRequestFromContext func ValidateRequestFromContext(ctx iris.Context, router routers.Router, options *Options) error { req := ctx.Request() route, pathParams, err := router.FindRoute(req) @@ -160,7 +160,7 @@ func ValidateRequestFromContext(ctx iris.Context, router routers.Router, options // GetIrisContext gets the iris context from within requests. It returns // nil if not found or wrong type. // -// Deprecated: This has been replaced by github.com/oapi-codegen/iris-middleware#GetIrisContext +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/iris-middleware#GetIrisContext func GetIrisContext(ctx context.Context) iris.Context { iface := ctx.Value(IrisContextKey) if iface == nil { @@ -174,7 +174,7 @@ func GetIrisContext(ctx context.Context) iris.Context { return nil } -// Deprecated: This has been replaced by github.com/oapi-codegen/iris-middleware#GetUserData +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/iris-middleware#GetUserData func GetUserData(ctx context.Context) interface{} { return ctx.Value(UserDataKey) } @@ -182,7 +182,7 @@ func GetUserData(ctx context.Context) interface{} { // getMultiErrorHandlerFromOptions attempts to get the MultiErrorHandler from the options. If it is not set, // return a default handler // -// Deprecated: This has been replaced by github.com/oapi-codegen/iris-middleware#getMultiErrorHandlerFromOptions +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/iris-middleware#getMultiErrorHandlerFromOptions func getMultiErrorHandlerFromOptions(options *Options) MultiErrorHandler { if options == nil { return defaultMultiErrorHandler @@ -199,7 +199,7 @@ func getMultiErrorHandlerFromOptions(options *Options) MultiErrorHandler { // of all the errors. This method is called if there are no other // methods defined on the options. // -// Deprecated: This has been replaced by github.com/oapi-codegen/iris-middleware#defaultMultiErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/iris-middleware#defaultMultiErrorHandler func defaultMultiErrorHandler(me openapi3.MultiError) error { return fmt.Errorf("multiple errors encountered: %s", me) } diff --git a/pkg/middleware/oapi_validate.go b/pkg/middleware/oapi_validate.go index ca9dd38e9..061d8710f 100644 --- a/pkg/middleware/oapi_validate.go +++ b/pkg/middleware/oapi_validate.go @@ -41,7 +41,7 @@ const ( // OAPI validation fails on the request, we return an HTTP/400. // Create validator middleware from a YAML file path // -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#OapiValidatorFromYamlFile +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#OapiValidatorFromYamlFile func OapiValidatorFromYamlFile(path string) (echo.MiddlewareFunc, error) { data, err := os.ReadFile(path) if err != nil { @@ -57,25 +57,25 @@ func OapiValidatorFromYamlFile(path string) (echo.MiddlewareFunc, error) { // OapiRequestValidator creates a validator from a swagger object. // -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#OapiRequestValidator +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#OapiRequestValidator func OapiRequestValidator(swagger *openapi3.T) echo.MiddlewareFunc { return OapiRequestValidatorWithOptions(swagger, nil) } // ErrorHandler is called when there is an error in validation // -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#ErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#ErrorHandler type ErrorHandler func(c echo.Context, err *echo.HTTPError) error // MultiErrorHandler is called when oapi returns a MultiError type // -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#MultiErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#MultiErrorHandler type MultiErrorHandler func(openapi3.MultiError) *echo.HTTPError // Options to customize request validation. These are passed through to // openapi3filter. // -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#Options +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#Options type Options struct { ErrorHandler ErrorHandler Options openapi3filter.Options @@ -89,7 +89,7 @@ type Options struct { // OapiRequestValidatorWithOptions creates a validator from a swagger object, with validation options // -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#OapiRequestValidatorWithOptions +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#OapiRequestValidatorWithOptions func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) echo.MiddlewareFunc { if swagger.Servers != nil && (options == nil || !options.SilenceServersWarning) { log.Println("WARN: OapiRequestValidatorWithOptions called with an OpenAPI spec that has `Servers` set. This may lead to an HTTP 400 with `no matching operation was found` when sending a valid request, as the validator performs `Host` header validation. If you're expecting `Host` header validation, you can silence this warning by setting `Options.SilenceServersWarning = true`. See https://github.com/deepmap/oapi-codegen/issues/882 for more information.") @@ -122,7 +122,7 @@ func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) echo // ValidateRequestFromContext is called from the middleware above and actually does the work // of validating a request. // -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#ValidateRequestFromContext +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#ValidateRequestFromContext func ValidateRequestFromContext(ctx echo.Context, router routers.Router, options *Options) *echo.HTTPError { req := ctx.Request() route, pathParams, err := router.FindRoute(req) @@ -205,7 +205,7 @@ func ValidateRequestFromContext(ctx echo.Context, router routers.Router, options // GetEchoContext gets the echo context from within requests. It returns // nil if not found or wrong type. // -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#GetEchoContext +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#GetEchoContext func GetEchoContext(c context.Context) echo.Context { iface := c.Value(EchoContextKey) if iface == nil { @@ -218,14 +218,14 @@ func GetEchoContext(c context.Context) echo.Context { return eCtx } -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#GetUserData +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#GetUserData func GetUserData(c context.Context) interface{} { return c.Value(UserDataKey) } // attempt to get the skipper from the options whether it is set or not // -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#getSkipperFromOptions +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#getSkipperFromOptions func getSkipperFromOptions(options *Options) echomiddleware.Skipper { if options == nil { return echomiddleware.DefaultSkipper @@ -240,7 +240,7 @@ func getSkipperFromOptions(options *Options) echomiddleware.Skipper { // attempt to get the MultiErrorHandler from the options. If it is not set, // return a default handler -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#getMultiErrorHandlerFromOptions +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#getMultiErrorHandlerFromOptions func getMultiErrorHandlerFromOptions(options *Options) MultiErrorHandler { if options == nil { return defaultMultiErrorHandler @@ -257,7 +257,7 @@ func getMultiErrorHandlerFromOptions(options *Options) MultiErrorHandler { // of all of the errors. This method is called if there are no other // methods defined on the options. // -// Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#defaultMultiErrorHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/echo-middleware#defaultMultiErrorHandler func defaultMultiErrorHandler(me openapi3.MultiError) *echo.HTTPError { return &echo.HTTPError{ Code: http.StatusBadRequest, diff --git a/pkg/runtime/bind.go b/pkg/runtime/bind.go index f80247856..4f9387d40 100644 --- a/pkg/runtime/bind.go +++ b/pkg/runtime/bind.go @@ -20,7 +20,7 @@ package runtime // By convention, to approximate the behavior of Bind functions themselves, // Binder implements Bind("") as a no-op. // -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#Binder +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#Binder type Binder interface { Bind(src string) error } diff --git a/pkg/runtime/bindform.go b/pkg/runtime/bindform.go index 77e38b500..5646440c9 100644 --- a/pkg/runtime/bindform.go +++ b/pkg/runtime/bindform.go @@ -16,14 +16,14 @@ import ( const tagName = "json" const jsonContentType = "application/json" -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#RequestBodyEncoding +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#RequestBodyEncoding type RequestBodyEncoding struct { ContentType string Style string Explode *bool } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#BindMultipart +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#BindMultipart func BindMultipart(ptr interface{}, reader multipart.Reader) error { const defaultMemory = 32 << 20 form, err := reader.ReadForm(defaultMemory) @@ -33,7 +33,7 @@ func BindMultipart(ptr interface{}, reader multipart.Reader) error { return BindForm(ptr, form.Value, form.File, nil) } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#BindForm +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#BindForm func BindForm(ptr interface{}, form map[string][]string, files map[string][]*multipart.FileHeader, encodings map[string]RequestBodyEncoding) error { ptrVal := reflect.Indirect(reflect.ValueOf(ptr)) if ptrVal.Kind() != reflect.Struct { @@ -82,7 +82,7 @@ func BindForm(ptr interface{}, form map[string][]string, files map[string][]*mul return nil } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#MarshalForm +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#MarshalForm func MarshalForm(ptr interface{}, encodings map[string]RequestBodyEncoding) (url.Values, error) { ptrVal := reflect.Indirect(reflect.ValueOf(ptr)) if ptrVal.Kind() != reflect.Struct { diff --git a/pkg/runtime/bindparam.go b/pkg/runtime/bindparam.go index 91463d787..1b08f941f 100644 --- a/pkg/runtime/bindparam.go +++ b/pkg/runtime/bindparam.go @@ -32,7 +32,7 @@ import ( // It is a backward compatible function to clients generated with codegen // up to version v1.5.5. v1.5.6+ calls the function below. // -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#BindStyledParameter +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#BindStyledParameter func BindStyledParameter(style string, explode bool, paramName string, value string, dest interface{}) error { return BindStyledParameterWithLocation(style, explode, paramName, ParamLocationUndefined, value, dest) @@ -42,7 +42,7 @@ func BindStyledParameter(style string, explode bool, paramName string, // section here to a Go object: // https://swagger.io/docs/specification/serialization/ // -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#BindStyledParameterWithLocation +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#BindStyledParameterWithLocation func BindStyledParameterWithLocation(style string, explode bool, paramName string, paramLocation ParamLocation, value string, dest interface{}) error { @@ -282,7 +282,7 @@ func bindSplitPartsToDestinationStruct(paramName string, parts []string, explode // you shouldn't pass objects via form styled query arguments, just use // the Content parameter form. // -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#BindQueryParameter +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#BindQueryParameter func BindQueryParameter(style string, explode bool, required bool, paramName string, queryParams url.Values, dest interface{}) error { diff --git a/pkg/runtime/bindstring.go b/pkg/runtime/bindstring.go index 6b128c41e..bb9645c48 100644 --- a/pkg/runtime/bindstring.go +++ b/pkg/runtime/bindstring.go @@ -31,7 +31,7 @@ import ( // know the destination type each place that we use this, is to generate code // to read each specific type. // -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#BindStringToObject +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#BindStringToObject func BindStringToObject(src string, dst interface{}) error { var err error diff --git a/pkg/runtime/deepobject.go b/pkg/runtime/deepobject.go index 15394540f..786cf5034 100644 --- a/pkg/runtime/deepobject.go +++ b/pkg/runtime/deepobject.go @@ -61,7 +61,7 @@ func marshalDeepObject(in interface{}, path []string) ([]string, error) { return result, nil } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#MarshalDeepObject +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#MarshalDeepObject func MarshalDeepObject(i interface{}, paramName string) (string, error) { // We're going to marshal to JSON and unmarshal into an interface{}, // which will use the json pkg to deal with all the field annotations. We @@ -124,7 +124,7 @@ func makeFieldOrValue(paths [][]string, values []string) fieldOrValue { return f } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#UnmarshalDeepObject +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#UnmarshalDeepObject func UnmarshalDeepObject(dst interface{}, paramName string, params url.Values) error { // Params are all the query args, so we need those that look like // "paramName["... diff --git a/pkg/runtime/jsonmerge.go b/pkg/runtime/jsonmerge.go index 3be61fcf0..0d5e88d95 100644 --- a/pkg/runtime/jsonmerge.go +++ b/pkg/runtime/jsonmerge.go @@ -9,7 +9,7 @@ import ( // JsonMerge merges two JSON representation into a single object. `data` is the // existing representation and `patch` is the new data to be merged in // -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#JsonMerge +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#JsonMerge func JsonMerge(data, patch json.RawMessage) (json.RawMessage, error) { merger := jsonmerge.Merger{ CopyNonexistent: true, diff --git a/pkg/runtime/strictmiddleware.go b/pkg/runtime/strictmiddleware.go index 894eba1e6..07e59fba0 100644 --- a/pkg/runtime/strictmiddleware.go +++ b/pkg/runtime/strictmiddleware.go @@ -9,26 +9,26 @@ import ( "github.com/labstack/echo/v4" ) -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/iris#StrictIrisHandlerFunc +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/strictmiddleware/iris#StrictIrisHandlerFunc type StrictIrisHandlerFunc func(ctx iris.Context, request interface{}) (response interface{}, err error) -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/iris#StrictIrisMiddlewareFunc +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/strictmiddleware/iris#StrictIrisMiddlewareFunc type StrictIrisMiddlewareFunc func(f StrictIrisHandlerFunc, operationID string) StrictIrisHandlerFunc -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/echo#StrictEchoHandlerFunc +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/strictmiddleware/echo#StrictEchoHandlerFunc type StrictEchoHandlerFunc func(ctx echo.Context, request interface{}) (response interface{}, err error) -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/echo#StrictEchoMiddlewareFunc +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/strictmiddleware/echo#StrictEchoMiddlewareFunc type StrictEchoMiddlewareFunc func(f StrictEchoHandlerFunc, operationID string) StrictEchoHandlerFunc -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/nethttp#StrictHttpHandlerFunc +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/strictmiddleware/nethttp#StrictHttpHandlerFunc type StrictHttpHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (response interface{}, err error) -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/nethttp#StrictHttpMiddlewareFunc +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/strictmiddleware/nethttp#StrictHttpMiddlewareFunc type StrictHttpMiddlewareFunc func(f StrictHttpHandlerFunc, operationID string) StrictHttpHandlerFunc -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/gin#StrictGinHandlerFunc +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/strictmiddleware/gin#StrictGinHandlerFunc type StrictGinHandlerFunc func(ctx *gin.Context, request interface{}) (response interface{}, err error) -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/gin#StrictGinMiddlewareFunc +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/strictmiddleware/gin#StrictGinMiddlewareFunc type StrictGinMiddlewareFunc func(f StrictGinHandlerFunc, operationID string) StrictGinHandlerFunc diff --git a/pkg/runtime/styleparam.go b/pkg/runtime/styleparam.go index 3e2ed0ccc..b9210a8b6 100644 --- a/pkg/runtime/styleparam.go +++ b/pkg/runtime/styleparam.go @@ -32,7 +32,7 @@ import ( // Parameter escaping works differently based on where a header is found // -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#ParamLocation +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#ParamLocation type ParamLocation int const ( @@ -48,7 +48,7 @@ const ( // function below, which can specialize its output based on the location of // the parameter. // -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#StyleParam +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#StyleParam func StyleParam(style string, explode bool, paramName string, value interface{}) (string, error) { return StyleParamWithLocation(style, explode, paramName, ParamLocationUndefined, value) } @@ -57,7 +57,7 @@ func StyleParam(style string, explode bool, paramName string, value interface{}) // into a parameter based on style/explode definition, performing whatever // escaping is necessary based on parameter location // -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime#StyleParam +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime#StyleParam func StyleParamWithLocation(style string, explode bool, paramName string, paramLocation ParamLocation, value interface{}) (string, error) { t := reflect.TypeOf(value) v := reflect.ValueOf(value) diff --git a/pkg/testutil/request_helpers.go b/pkg/testutil/request_helpers.go index b789e0f76..a4304e101 100644 --- a/pkg/testutil/request_helpers.go +++ b/pkg/testutil/request_helpers.go @@ -36,7 +36,7 @@ import ( "github.com/labstack/echo/v4" ) -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#NewRequest +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#NewRequest func NewRequest() *RequestBuilder { return &RequestBuilder{ Headers: make(map[string]string), @@ -45,7 +45,7 @@ func NewRequest() *RequestBuilder { // RequestBuilder caches request settings as we build up the request. // -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder type RequestBuilder struct { Method string Path string @@ -57,80 +57,80 @@ type RequestBuilder struct { // WithMethod sets the method and path // -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithMethod +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithMethod func (r *RequestBuilder) WithMethod(method string, path string) *RequestBuilder { r.Method = method r.Path = path return r } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.Get +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.Get func (r *RequestBuilder) Get(path string) *RequestBuilder { return r.WithMethod("GET", path) } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.Post +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.Post func (r *RequestBuilder) Post(path string) *RequestBuilder { return r.WithMethod("POST", path) } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.Put +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.Put func (r *RequestBuilder) Put(path string) *RequestBuilder { return r.WithMethod("PUT", path) } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.Patch +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.Patch func (r *RequestBuilder) Patch(path string) *RequestBuilder { return r.WithMethod("PATCH", path) } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.Delete +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.Delete func (r *RequestBuilder) Delete(path string) *RequestBuilder { return r.WithMethod("DELETE", path) } // WithHeader sets a header // -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithHeader +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithHeader func (r *RequestBuilder) WithHeader(header, value string) *RequestBuilder { r.Headers[header] = value return r } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithJWSAuth +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithJWSAuth func (r *RequestBuilder) WithJWSAuth(jws string) *RequestBuilder { r.Headers["Authorization"] = "Bearer " + jws return r } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithHost +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithHost func (r *RequestBuilder) WithHost(value string) *RequestBuilder { return r.WithHeader("Host", value) } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithContentType +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithContentType func (r *RequestBuilder) WithContentType(value string) *RequestBuilder { return r.WithHeader("Content-Type", value) } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithJsonContentType +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithJsonContentType func (r *RequestBuilder) WithJsonContentType() *RequestBuilder { return r.WithContentType("application/json") } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithAccept +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithAccept func (r *RequestBuilder) WithAccept(value string) *RequestBuilder { return r.WithHeader("Accept", value) } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithAcceptJson +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithAcceptJson func (r *RequestBuilder) WithAcceptJson() *RequestBuilder { return r.WithAccept("application/json") } // Request body operations -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithBody +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithBody func (r *RequestBuilder) WithBody(body []byte) *RequestBuilder { r.Body = body return r @@ -139,7 +139,7 @@ func (r *RequestBuilder) WithBody(body []byte) *RequestBuilder { // WithJsonBody takes an object as input, marshals it to JSON, and sends it // as the body with Content-Type: application/json // -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithJsonBody +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithJsonBody func (r *RequestBuilder) WithJsonBody(obj interface{}) *RequestBuilder { var err error r.Body, err = json.Marshal(obj) @@ -151,13 +151,13 @@ func (r *RequestBuilder) WithJsonBody(obj interface{}) *RequestBuilder { // WithCookie sets a cookie // -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithCookie +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithCookie func (r *RequestBuilder) WithCookie(c *http.Cookie) *RequestBuilder { r.Cookies = append(r.Cookies, c) return r } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.WithCookieNameValue +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithCookieNameValue func (r *RequestBuilder) WithCookieNameValue(name, value string) *RequestBuilder { return r.WithCookie(&http.Cookie{Name: name, Value: value}) } @@ -165,7 +165,7 @@ func (r *RequestBuilder) WithCookieNameValue(name, value string) *RequestBuilder // GoWithHTTPHandler performs the request, it takes a pointer to a testing context // to print messages, and a http handler for request handling. // -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#GoWithHTTPHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#GoWithHTTPHandler func (r *RequestBuilder) GoWithHTTPHandler(t *testing.T, handler http.Handler) *CompletedRequest { if r.Error != nil { // Fail the test if we had an error @@ -199,7 +199,7 @@ func (r *RequestBuilder) GoWithHTTPHandler(t *testing.T, handler http.Handler) * // Go performs the request, it takes a pointer to a testing context // to print messages, and a pointer to an echo context for request handling. // -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RequestBuilder.GoWithHTTPHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.GoWithHTTPHandler func (r *RequestBuilder) Go(t *testing.T, e *echo.Echo) *CompletedRequest { return r.GoWithHTTPHandler(t, e) } @@ -207,7 +207,7 @@ func (r *RequestBuilder) Go(t *testing.T, e *echo.Echo) *CompletedRequest { // CompletedRequest is the result of calling Go() on the request builder. We're wrapping the // ResponseRecorder with some nice helper functions. // -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#CompletedRequest +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#CompletedRequest type CompletedRequest struct { Recorder *httptest.ResponseRecorder @@ -216,7 +216,7 @@ type CompletedRequest struct { Strict bool } -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#CompletedRequest.DisallowUnknownFields +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#CompletedRequest.DisallowUnknownFields func (c *CompletedRequest) DisallowUnknownFields() { c.Strict = true } @@ -224,7 +224,7 @@ func (c *CompletedRequest) DisallowUnknownFields() { // UnmarshalBodyToObject takes a destination object as input, and unmarshals the object // in the response based on the Content-Type header. // -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#CompletedRequest.UnmarshalBodyToObject +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#CompletedRequest.UnmarshalBodyToObject func (c *CompletedRequest) UnmarshalBodyToObject(obj interface{}) error { ctype := c.Recorder.Header().Get("Content-Type") @@ -242,14 +242,14 @@ func (c *CompletedRequest) UnmarshalBodyToObject(obj interface{}) error { // UnmarshalJsonToObject assumes that the response contains JSON and unmarshals it // into the specified object. // -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#CompletedRequest.UnmarshalJsonToObject +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#CompletedRequest.UnmarshalJsonToObject func (c *CompletedRequest) UnmarshalJsonToObject(obj interface{}) error { return json.Unmarshal(c.Recorder.Body.Bytes(), obj) } // Code is a shortcut for response code // -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#CompletedRequest.Code +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#CompletedRequest.Code func (c *CompletedRequest) Code() int { return c.Recorder.Code } diff --git a/pkg/testutil/response_handlers.go b/pkg/testutil/response_handlers.go index 4724177f7..1fa0ffe90 100644 --- a/pkg/testutil/response_handlers.go +++ b/pkg/testutil/response_handlers.go @@ -17,10 +17,10 @@ var ( knownHandlers map[string]ResponseHandler ) -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#ResponseHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#ResponseHandler type ResponseHandler func(contentType string, raw io.Reader, obj interface{}, strict bool) error -// Deprecated: This has been replaced by github.com/oapi-codegen/testutil#RegisterResponseHandler +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RegisterResponseHandler func RegisterResponseHandler(mime string, handler ResponseHandler) { knownHandlersMu.Lock() defer knownHandlersMu.Unlock() diff --git a/pkg/types/date.go b/pkg/types/date.go index 089aa425e..f291c9363 100644 --- a/pkg/types/date.go +++ b/pkg/types/date.go @@ -5,20 +5,20 @@ import ( "time" ) -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#DateFormat +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#DateFormat const DateFormat = "2006-01-02" -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#Date +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#Date type Date struct { time.Time } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#MarshalJSON +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#MarshalJSON func (d Date) MarshalJSON() ([]byte, error) { return json.Marshal(d.Time.Format(DateFormat)) } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#UnmarshalJSON +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#UnmarshalJSON func (d *Date) UnmarshalJSON(data []byte) error { var dateStr string err := json.Unmarshal(data, &dateStr) @@ -33,12 +33,12 @@ func (d *Date) UnmarshalJSON(data []byte) error { return nil } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#String +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#String func (d Date) String() string { return d.Time.Format(DateFormat) } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#UnmarshalText +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#UnmarshalText func (d *Date) UnmarshalText(data []byte) error { parsed, err := time.Parse(DateFormat, string(data)) if err != nil { diff --git a/pkg/types/email.go b/pkg/types/email.go index 520f68a5a..5aa24ab69 100644 --- a/pkg/types/email.go +++ b/pkg/types/email.go @@ -7,17 +7,17 @@ import ( // ErrValidationEmail is the sentinel error returned when an email fails validation // -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#ErrValidationEmail +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#ErrValidationEmail var ErrValidationEmail = errors.New("email: failed to pass regex validation") // Email represents an email address. // It is a string type that must pass regex validation before being marshalled // to JSON or unmarshalled from JSON. // -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#Email +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#Email type Email string -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#MarshalJSON +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#MarshalJSON func (e Email) MarshalJSON() ([]byte, error) { if !emailRegex.MatchString(string(e)) { return nil, ErrValidationEmail @@ -26,7 +26,7 @@ func (e Email) MarshalJSON() ([]byte, error) { return json.Marshal(string(e)) } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#UnmarshalJSON +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#UnmarshalJSON func (e *Email) UnmarshalJSON(data []byte) error { if e == nil { return nil diff --git a/pkg/types/file.go b/pkg/types/file.go index 653ea8752..baff91365 100644 --- a/pkg/types/file.go +++ b/pkg/types/file.go @@ -7,28 +7,28 @@ import ( "mime/multipart" ) -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#File +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#File type File struct { multipart *multipart.FileHeader data []byte filename string } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#InitFromMultipart +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#InitFromMultipart func (file *File) InitFromMultipart(header *multipart.FileHeader) { file.multipart = header file.data = nil file.filename = "" } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#InitFromBytes +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#InitFromBytes func (file *File) InitFromBytes(data []byte, filename string) { file.data = data file.filename = filename file.multipart = nil } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#MarshalJSON +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#MarshalJSON func (file File) MarshalJSON() ([]byte, error) { b, err := file.Bytes() if err != nil { @@ -37,12 +37,12 @@ func (file File) MarshalJSON() ([]byte, error) { return json.Marshal(b) } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#UnmarshalJSON +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#UnmarshalJSON func (file *File) UnmarshalJSON(data []byte) error { return json.Unmarshal(data, &file.data) } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#Bytes +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#Bytes func (file File) Bytes() ([]byte, error) { if file.multipart != nil { f, err := file.multipart.Open() @@ -55,7 +55,7 @@ func (file File) Bytes() ([]byte, error) { return file.data, nil } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#Reader +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#Reader func (file File) Reader() (io.ReadCloser, error) { if file.multipart != nil { return file.multipart.Open() @@ -63,7 +63,7 @@ func (file File) Reader() (io.ReadCloser, error) { return io.NopCloser(bytes.NewReader(file.data)), nil } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#Filename +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#Filename func (file File) Filename() string { if file.multipart != nil { return file.multipart.Filename @@ -71,7 +71,7 @@ func (file File) Filename() string { return file.filename } -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#FileSize +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#FileSize func (file File) FileSize() int64 { if file.multipart != nil { return file.multipart.Size diff --git a/pkg/types/uuid.go b/pkg/types/uuid.go index 56b443ea8..cc52a4ecd 100644 --- a/pkg/types/uuid.go +++ b/pkg/types/uuid.go @@ -4,5 +4,5 @@ import ( "github.com/google/uuid" ) -// Deprecated: This has been replaced by github.com/oapi-codegen/runtime/types#UUID +// Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/runtime/types#UUID type UUID = uuid.UUID
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: