update prometheus dependencies (#5520)
Signed-off-by: junot <junotxiang@kubesphere.io>
This commit is contained in:
14
vendor/github.com/go-openapi/validate/object_validator.go
generated
vendored
14
vendor/github.com/go-openapi/validate/object_validator.go
generated
vendored
@@ -71,8 +71,8 @@ func (o *objectValidator) checkArrayMustHaveItems(res *Result, val map[string]in
|
||||
// with pure jsonschema draft 4, one may have arrays with undefined items (i.e. any type).
|
||||
if t, typeFound := val[jsonType]; typeFound {
|
||||
if tpe, ok := t.(string); ok && tpe == arrayType {
|
||||
if _, itemsKeyFound := val[jsonItems]; !itemsKeyFound {
|
||||
res.AddErrors(errors.Required(jsonItems, o.Path))
|
||||
if item, itemsKeyFound := val[jsonItems]; !itemsKeyFound {
|
||||
res.AddErrors(errors.Required(jsonItems, o.Path, item))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ func (o *objectValidator) checkItemsMustBeTypeArray(res *Result, val map[string]
|
||||
}
|
||||
} else {
|
||||
// there is no type
|
||||
res.AddErrors(errors.Required(jsonType, o.Path))
|
||||
res.AddErrors(errors.Required(jsonType, o.Path, t))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,8 +227,8 @@ func (o *objectValidator) Validate(data interface{}) *Result {
|
||||
// Check required properties
|
||||
if len(o.Required) > 0 {
|
||||
for _, k := range o.Required {
|
||||
if _, ok := val[k]; !ok && !createdFromDefaults[k] {
|
||||
res.AddErrors(errors.Required(o.Path+"."+k, o.In))
|
||||
if v, ok := val[k]; !ok && !createdFromDefaults[k] {
|
||||
res.AddErrors(errors.Required(o.Path+"."+k, o.In, v))
|
||||
continue
|
||||
}
|
||||
}
|
||||
@@ -271,9 +271,9 @@ func (o *objectValidator) validatePatternProperty(key string, value interface{},
|
||||
|
||||
// BUG(fredbi): can't get to here. Should remove dead code (commented out).
|
||||
|
||||
//if succeededOnce {
|
||||
// if succeededOnce {
|
||||
// result.Inc()
|
||||
//}
|
||||
// }
|
||||
|
||||
return matched, succeededOnce, patterns
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user