Specify min and max arity via attribute #409
Labels
feature
help wanted
up-for-grabs
Curated tasks specifically for new contributors (see https://up-for-grabs.net )
Currently, the one way to specify a min other than 0 or 1 or a Max other than 0, 1 or "More" is via middleware or interceptor methods. It could be beneficial to be able to assign an arbitrary min and max for collection arguments. This would be done by adding MinCount & MaxCount properties to the Option and Operand attributes and checking the value in the ArgumentArity.Default method. There should be tests to verify the arity is set correctly and an InvalidConfigurationException should be thrown if the values are not valid for the type definition, i.e. if Min or Max is greater than 1 and the type is not an IEnumerable
The text was updated successfully, but these errors were encountered: