Пример #1
0
func maxItemsError(param *spec.Parameter) *errors.Validation {
	return errors.TooManyItems(param.Name, param.In, *param.MaxItems)
}
func maxItemsErrorItems(path, in string, items *spec.Items) *errors.Validation {
	return errors.TooManyItems(path, in, *items.MaxItems)
}
Пример #3
0
// MaxItems validates that there are at most n items in a slice
func MaxItems(path, in string, size, max int64) *errors.Validation {
	if size > max {
		return errors.TooManyItems(path, in, max)
	}
	return nil
}