As you can see below there is an array parameter passed to the validated method. For validation I'm using SimpleSchema.
client
const url = "/articles/bmphCpyHZLhTc74Zp"
example.call({ item: url.split('/') })
server
example = new ValidatedMethod({
name : 'example',
validate: new SimpleSchema({
item: {
type: [String]
}
}).validator(),
run({ item }) {
console.log(item)
}
})
But I would like to validate a bit more specific. So the item array must have three elements.
The first is empty, the second should use a value set by allowedValues
and the third is an ID SimpleSchema.RegEx.Id