Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Nicer API for repeat validation #105

@itamarst

Description

@itamarst

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:

  1. Create a lexer.
  2. Create a parser.
  3. 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)?
}

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions