summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-openapi/validate/formats.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-openapi/validate/formats.go')
-rw-r--r--vendor/github.com/go-openapi/validate/formats.go14
1 files changed, 5 insertions, 9 deletions
diff --git a/vendor/github.com/go-openapi/validate/formats.go b/vendor/github.com/go-openapi/validate/formats.go
index b7afe981bc..0ad996cbbc 100644
--- a/vendor/github.com/go-openapi/validate/formats.go
+++ b/vendor/github.com/go-openapi/validate/formats.go
@@ -37,19 +37,15 @@ func (f *formatValidator) Applies(source interface{}, kind reflect.Kind) bool {
if source == nil {
return false
}
- switch source.(type) {
+ switch source := source.(type) {
case *spec.Items:
- it := source.(*spec.Items)
- return kind == reflect.String && f.KnownFormats.ContainsName(it.Format)
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
case *spec.Parameter:
- par := source.(*spec.Parameter)
- return kind == reflect.String && f.KnownFormats.ContainsName(par.Format)
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
case *spec.Schema:
- sch := source.(*spec.Schema)
- return kind == reflect.String && f.KnownFormats.ContainsName(sch.Format)
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
case *spec.Header:
- hdr := source.(*spec.Header)
- return kind == reflect.String && f.KnownFormats.ContainsName(hdr.Format)
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
}
return false
}