@@ -20,17 +20,16 @@ import (
2020 "strings"
2121
2222 "github.com/go-openapi/errors"
23- "github.com/go-openapi/swag"
24-
2523 "github.com/go-openapi/runtime"
24+ "github.com/go-openapi/swag/stringutils"
2625)
2726
2827type validation struct {
2928 context * Context
3029 result []error
3130 request * http.Request
3231 route * MatchedRoute
33- bound map [string ]interface {}
32+ bound map [string ]any
3433}
3534
3635// ContentType validates the content type of a request
@@ -42,14 +41,14 @@ func validateContentType(allowed []string, actual string) error {
4241 if err != nil {
4342 return errors .InvalidContentType (actual , allowed )
4443 }
45- if swag .ContainsStringsCI (allowed , mt ) {
44+ if stringutils .ContainsStringsCI (allowed , mt ) {
4645 return nil
4746 }
48- if swag .ContainsStringsCI (allowed , "*/*" ) {
47+ if stringutils .ContainsStringsCI (allowed , "*/*" ) {
4948 return nil
5049 }
5150 parts := strings .Split (actual , "/" )
52- if len (parts ) == 2 && swag .ContainsStringsCI (allowed , parts [0 ]+ "/*" ) {
51+ if len (parts ) == 2 && stringutils .ContainsStringsCI (allowed , parts [0 ]+ "/*" ) {
5352 return nil
5453 }
5554 return errors .InvalidContentType (actual , allowed )
@@ -60,7 +59,7 @@ func validateRequest(ctx *Context, request *http.Request, route *MatchedRoute) *
6059 context : ctx ,
6160 request : request ,
6261 route : route ,
63- bound : make (map [string ]interface {} ),
62+ bound : make (map [string ]any ),
6463 }
6564 validate .debugLogf ("validating request %s %s" , request .Method , request .URL .EscapedPath ())
6665
@@ -83,7 +82,7 @@ func (v *validation) parameters() {
8382 v .debugLogf ("validating request parameters for %s %s" , v .request .Method , v .request .URL .EscapedPath ())
8483 if result := v .route .Binder .Bind (v .request , v .route .Params , v .route .Consumer , v .bound ); result != nil {
8584 if result .Error () == "validation failure list" {
86- for _ , e := range result .(* errors.Validation ).Value .([]interface {} ) {
85+ for _ , e := range result .(* errors.Validation ).Value .([]any ) {
8786 v .result = append (v .result , e .(error ))
8887 }
8988 return
0 commit comments