func minItemsError(param *spec.Parameter) *errors.Validation {
	return errors.TooFewItems(param.Name, param.In, *param.MinItems)
}
func minItemsErrorItems(path, in string, items *spec.Items) *errors.Validation {
	return errors.TooFewItems(path, in, *items.MinItems)
}
Example #3
0
// MinItems validates that there are at least n items in a slice
func MinItems(path, in string, size, min int64) *errors.Validation {
	if size < min {
		return errors.TooFewItems(path, in, min)
	}
	return nil
}