cddl-rs

crates.io docs.rs

This library is very much experimental and is being developed as a personal learning exercise for learning Rust and about parsing in general. It is far from complete. There are likely more performant and stable libraries out there for parsing CDDL. This one should not be used in production in any form or fashion.

A Rust implementation of the Concise data definition language (CDDL). CDDL is an IETF draft standard that "proposes a notational convention to express CBOR and JSON data structures." The current draft can be found at https://tools.ietf.org/html/draft-ietf-cbor-cddl-08 and is currently in AUTH48 state as of 2019-05-24 (RFC-to-be 8610), per https://www.rfc-editor.org/auth48/rfc8610.

This library includes a handwritten parser and lexer for CDDL and is heavily inspired by Thorsten Ball's book "Writing An Interpretor In Go". The AST has been built to closely match the rules defined by the ABNF grammar in Appendix B. of the spec.

I'm currently only focused on using CDDL as a means for validating JSON data, and as such, work is being done to build a JSON validation component into the library. An extremely basic REPL is included as well.

Goals

Non-goals

Features supported by the parser