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