func maxItemsError(param *spec.Parameter) *errors.Validation {
	return errors.TooManyItems(param.Name, param.In, *param.MaxItems)
}
Beispiel #2
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
}
func maxItemsErrorItems(path, in string, items *spec.Items) *errors.Validation {
	return errors.TooManyItems(path, in, *items.MaxItems)
}