customDocumentRules property
Defines custom rules for specific document class.
When defining DocumentRules, DocumentFilter is optionally set to specify the document to which the rule applies, and a fields
with
the appropriate alphabetType
should be specified as mandatory for that document.
If a fields
is set to a field that is optional for that document or does not exist on it, all fields on the document become optional.
If a fields
is set to a field with an incorrect alphabetType, all fields on the document become optional.
If a fields
is set to a field that doesn’t exist in the internal rules, that rule is ignored.
When adding multiple fields
, any field that does not match our rules is ignored. Only fields that comply with our rules are set as mandatory.
If the documentFilter fields country
, region
, or type
are set to null
, all supported values for those fields will be considered.
For example, if country = null
, the rule will apply to all supported countries in BlinkID.
By default, document fields are validated using internal rules that define mandatory fields for the scanned document class. This setting allows users to narrow down our internal rules on mandatory fields. All undefined fields will become optional. It is not possible to mark fields as mandatory if they cannot theoretically appear on the document. The more detailed document filter will have priority over the other.
See DocumentRules for more detailed information.
Implementation
List<DocumentRules>? customDocumentRules;