-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Description
- This API is not documented as supporting both JSON and CBOR, so I assumed it was just CBOR (https://docs.rs/cddl/latest/cddl/ast/struct.CDDL.html#method.validate). Assuming is bad, but also CBOR is the default for what CDDL does.
- A bunch of the logic in there is something I'm going to have reproduce, since I need to only do CBOR and I'm keeping around a
CDDL
instance. - I discovered this because it guessed wrong on a document because every once in a while the CBOR is valid UTF8, coincidentally.
Perhaps there should be CDDL::validate_cbor()
and validate_json()
?
I am not sure an auto-guessing method is super-useful, but if it continues to exit the fact it's guessing should be documented, as well as the heuristic it uses.
If you can indicate your preferred next step, I can submit an appropriate PR.
Metadata
Metadata
Assignees
Labels
No labels