ContentValidator¶
The ContentValidator checks, if the contents of a message conform to a set of predefined rules. This allows docproc to process only those messages, which are considered functionally valid.
Configuration¶
The ContentValidator requires the following configuration entries:
[contentvalidator-config]
type = ContentValidator
rules = /path/to/a/rules/set
- type
- To configure a ContentValidator, use
ContentValidator
astype
. - rules
rules
refers to a file on disk containing the rules to be executed on the message content. A rule consists of one or more conditions.
Defining Rules¶
The rules to be executed are kept in a simple JSON-based list.
[
{
"name": "First rule",
"path": "NET",
"op": "less than",
"value": 0,
},
{
"name": "Second rule",
"path": "ZIP",
"op": "exists",
}
]
See Operating the Rules Engine for more details about how to configure rules.