Skip to content

Instantly share code, notes, and snippets.

@adzialocha
Last active February 11, 2022 13:46
Show Gist options
  • Save adzialocha/6bbd8e749b62a8a036bc6163ef54602f to your computer and use it in GitHub Desktop.
Save adzialocha/6bbd8e749b62a8a036bc6163ef54602f to your computer and use it in GitHub Desktop.
How to work with CBOR and CDDL

How to work with CBOR and CDDL

Helpful pages

Tools

hew crate

cddl gem

  • Install via gem install cddl
  • Run via cddl ./spec.cddl validate ./test.cbor (only works when CBOR is represented in binary format, use hew above)
  • cddl ./spec.cddl generate <n> generate test data based on schema,same for JSON: cddl ./spec.cddl json-generate <n>

cbor-diag gem

  • Install via gem install cbor-diag

cddl crate

  • Run via cddl validate [FLAGS] --cddl <CDDL> [FILE]...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment