示例#1
0
func multipleOfError(param *spec.Parameter) *errors.Validation {
	return errors.NotMultipleOf(param.Name, param.In, *param.MultipleOf)
}
示例#2
0
// 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) {
		return errors.NotMultipleOf(path, in, factor)
	}
	return nil
}
示例#3
0
func multipleOfErrorItems(path, in string, items *spec.Items) *errors.Validation {
	return errors.NotMultipleOf(path, in, *items.MultipleOf)
}