cddl icon indicating copy to clipboard operation
cddl copied to clipboard

wishlist: Simplify creation of new validators

Open chrysn opened this issue 1 year ago • 1 comments

Currently, the validators for JSON and CBOR contain a mix of serialization-specific code and CDDL tracking (which AIU includes much of the error handling), as evidenced by the large similarity between src/validator/{cbor,json}.rs. This makes it hard to add another validator, in my case, one that processes CBOR diagnostic notation (where the goal is to leave information in the tree that is being visited, eg. spelling out numeric keys with comments or picking <<1>> instead of h'01' when seeing a .cbor).

Hoisting out commonalities from those two files might also help with #219.

chrysn avatar Jun 20 '24 08:06 chrysn

Totally agree! Would love to do this at some point but just haven't gotten around to it. You're welcome to submit some approaches in a PR or two!

anweiss avatar Feb 05 '25 03:02 anweiss