Apply other validations over arrays
NotTheRealJoe opened this issue · 0 comments
NotTheRealJoe commented
Feature suggestion: it would be useful to be able to apply the other validations that structure provides over the content of an array.
For example, instead of just itemType: String
, being able to use the equal
and nullable
validations:
const User = attributes({
roles: {
type: Array
item: {
type: String,
nullable: false,
equals: ['reader', 'editor', 'moderator' ... ]
}
}
...
});