We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encoding/json uses map[string]interface{} which is incompatible with map[interface{}]interface{}. parsing cbor and encoding to json is not happy:
encoding/json
map[string]interface{}
map[interface{}]interface{}
json: unsupported type: map[interface {}]interface {}
The text was updated successfully, but these errors were encountered:
I made a nice cli tool to check this:
cat a_bunch_of.json | json2cbor j2c >a_bunch_of.cbor cat a_bunch_of.cbor | json2cbor c2j >a_bunch_of.json
Can use with https://github.com/jbenet/node-random-json-stream to check things. Setup:
go get github.com/jbenet/go-json2cbor/json2cbor npm install -g random-json-stream
Test codec with:
random-json -o | json2cbor j2c | json2cbor c2j
Test JSON->CBOR->JSON roundtripping with:
random-json -o -c 10 | tee a.json | json2cbor j2c | json2cbor c2j >b.json && diff a.json b.json
Sorry, something went wrong.
I should note that the codec seems to fail when i try to convert 10+ json->cbor->json items. with:
unexpected EOF
it could be the tool, but i believe it's something about the codec.
nevermind. I made a mistake
No branches or pull requests
encoding/json
usesmap[string]interface{}
which is incompatible withmap[interface{}]interface{}
. parsing cbor and encoding to json is not happy:The text was updated successfully, but these errors were encountered: