Open extemporalgenome opened 4 weeks ago
> {
echo '{"a":1}' | cbor-diag --to=bytes ;
echo '{"b":2}' | cbor-diag --to=bytes ;
} | cbor-diag --seq --to=annotated
a1 # map(1)
61 # text(1)
61 # "a"
01 # unsigned(1)
a1 # map(1)
61 # text(1)
62 # "b"
02 # unsigned(2)
--seq
currently implies --from=bytes
, but it seems reasonable to support other formats with it too (would need to add more _partial
functions to the library for them).
https://www.rfc-editor.org/rfc/rfc8742.html
For example, if support for cbor sequences were present, I believe the following should parse:
Ideally the following would work as well (accept jsonl/ndjson and other representations of sequences of documents):