Open
Description
Currently every document type is presumed to use the object
validation type, where each property's name and type is known beforehand. However, there may be cases where it is useful to use hashtable
validation for a particular document type so that the property/key names don't need to be known beforehand while still providing the flexibility to perform validation on the property values.
For example (not to be considered final):
myDocType: {
typeFilter: ...
channels: ...
type: 'hashtable',
hashtableKeysValidator: {
regexPattern: /^\w+$/
},
hashtableElementsValidator: {
type: 'integer',
required: true,
minimumValue: 0
}
}
For the sake of backward compatibility, the default validation type for documents should continue to be object
.