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)
}