bump(go-openapi/validate): d509235108fcf6ab4913d2dcb3a2260c0db2108e
This commit is contained in:
6
vendor/github.com/go-openapi/validate/values.go
generated
vendored
6
vendor/github.com/go-openapi/validate/values.go
generated
vendored
@@ -196,7 +196,11 @@ func MinimumUint(path, in string, data, min uint64, exclusive bool) *errors.Vali
|
||||
|
||||
// MultipleOf validates if the provided number is a multiple of the factor
|
||||
func MultipleOf(path, in string, data, factor float64) *errors.Validation {
|
||||
if !swag.IsFloat64AJSONInteger(data / factor) {
|
||||
mult := data / factor
|
||||
if factor < 1 {
|
||||
mult = 1 / factor * data
|
||||
}
|
||||
if !swag.IsFloat64AJSONInteger(mult) {
|
||||
return errors.NotMultipleOf(path, in, factor)
|
||||
}
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user