Пример #1
0
func multipleOfError(param *spec.Parameter) *errors.Validation {
	return errors.NotMultipleOf(param.Name, param.In, *param.MultipleOf)
}
func multipleOfErrorItems(path, in string, items *spec.Items) *errors.Validation {
	return errors.NotMultipleOf(path, in, *items.MultipleOf)
}
Пример #3
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
}