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.
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 ofh'01'
when seeing a.cbor
).Hoisting out commonalities from those two files might also help with #219.