Allow generated property methods to validate the cardinality of values. Fixes #632