Thanks to visit codestin.com
Credit goes to github.com

Skip to content

"Top level object must be a map or array" - why? #3

Description

@Qix-

With the data

a2 4f 4b

I get

msgpack2json: Top-level object must be a map or array. Try debug viewing mode (-d)
mpack breakpoint hit at /tmp/msgpack-tools-20160714-1642-vla6bf/msgpack-tools-0.4/contrib/mpack-8c13a0d7f8a1232a189634768b94740861cbaf3e/src/mpack/mpack-common.c:321

But why? A single string "OK" is valid JSON, technically speaking. As well, MessagePack's specification doesn't enforce that - let alone does it even mention top level objects.

For instance, running just the string "OK" through jq gives me perfectly normal output.

$ echo "\"OK\"" | jq ''
"OK"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions