Update a few dependencies
github.com/go-openapi/* github.com/asaskevich/govalidator
This commit is contained in:
9
vendor/github.com/go-openapi/validate/formats.go
generated
vendored
9
vendor/github.com/go-openapi/validate/formats.go
generated
vendored
@@ -15,7 +15,6 @@
|
||||
package validate
|
||||
|
||||
import (
|
||||
"log"
|
||||
"reflect"
|
||||
|
||||
"github.com/go-openapi/spec"
|
||||
@@ -48,18 +47,20 @@ func (f *formatValidator) Applies(source interface{}, kind reflect.Kind) bool {
|
||||
case *spec.Schema:
|
||||
sch := source.(*spec.Schema)
|
||||
return kind == reflect.String && f.KnownFormats.ContainsName(sch.Format)
|
||||
case *spec.Header:
|
||||
hdr := source.(*spec.Header)
|
||||
return kind == reflect.String && f.KnownFormats.ContainsName(hdr.Format)
|
||||
}
|
||||
return false
|
||||
}
|
||||
r := doit()
|
||||
if Debug {
|
||||
log.Printf("format validator for %q applies %t for %T (kind: %v)\n", f.Path, r, source, kind)
|
||||
}
|
||||
debugLog("format validator for %q applies %t for %T (kind: %v)\n", f.Path, r, source, kind)
|
||||
return r
|
||||
}
|
||||
|
||||
func (f *formatValidator) Validate(val interface{}) *Result {
|
||||
result := new(Result)
|
||||
debugLog("validating \"%v\" against format: %s", val, f.Format)
|
||||
|
||||
if err := FormatOf(f.Path, f.In, f.Format, val.(string), f.KnownFormats); err != nil {
|
||||
result.AddErrors(err)
|
||||
|
Reference in New Issue
Block a user