-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Description
A common pattern is to use the same schema to validate multiple documents. In the current API, this requires a bunch of work involving the innards of the implementation:
- Create a lexer.
- Create a parser.
- For each document to be parsed, create a validator, since validators are single-shot.
A nicer API would be something like:
let cddl_schema = CDDLSchema::from_slice(my_schema_bytes);
for document in documents {
cdd_schema.validate(document)?
}