-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Description
Hi!
We're considering supporting actual json and cbor data formats in Kubo (ref). As I was testing if JSON worked properly, I run into the following:
~ ❯ ipfs dag put --input-codec json --store-codec json
ipfs: Reading from /dev/stdin; send Ctrl-d to stop.
{ 10: "hello" }
Error: unexpected int token while expecting map key
After looking at the code, it seems that the codec json actually uses the codec dag-json for decoding (and encoding), which means that json doesn't support many of the features of real JSON.
go-ipld-prime/codec/json/multicodec.go
Lines 24 to 33 in 7548eb8
| // Decode deserializes data from the given io.Reader and feeds it into the given datamodel.NodeAssembler. | |
| // Decode fits the codec.Decoder function interface. | |
| // | |
| // This is the function that will be registered in the default multicodec registry during package init time. | |
| func Decode(na datamodel.NodeAssembler, r io.Reader) error { | |
| return dagjson.DecodeOptions{ | |
| ParseLinks: false, | |
| ParseBytes: false, | |
| }.Decode(na, r) | |
| } |
Is this a bug, or not? If not, why? If yes, are there any plans for fixing this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels