wishlist: Simplify creation of new validators
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.
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!