cbor2 icon indicating copy to clipboard operation
cbor2 copied to clipboard

CLI support for encoding/importing from JSON

Open chenliu0831 opened this issue 1 year ago • 2 comments

Things to check first

  • [X] I have searched the existing issues and didn't find my feature already requested there

Feature description

Currently the CLI tool only supports converting CBOR data to representation that allows printing as JSON. The reverse serialization / importing is also a common task.

Happy to contribute as well.

Use case

It's convenient for manual testing with human readable JSON files/payload. Supported in this Rust project as well https://github.com/TakenPilot/cbor-cli.

Examples:

cbor2 -o test.cbor test.json --format=json

chenliu0831 avatar Mar 01 '24 02:03 chenliu0831

@agronholm gentle ping, any thoughts on the feature and interface?

chenliu0831 avatar Mar 06 '24 19:03 chenliu0831

I might be open to that, but would require a PR with tests, any necessary docs updates and a changelog entry.

agronholm avatar Mar 06 '24 19:03 agronholm