Skip to content

Don't quote MessagePack scalar values at the top level #31

@nyoung-figly

Description

@nyoung-figly

It seems like the MessagePack transit writer quotes scalar values at the top level. Reading through the spec: https://github.com/cognitect/transit-format#quoting it seems like there's a good reason for doing this for JSON, but I'm not sure that same reason carries over into MessagePack, especially since users of the binary protocol might be more space conscious?

(def bs (java.io.ByteArrayOutputStream.))
(def writer (transit/writer bs :msgpack))
(transit/write writer 42)
(do (doseq [b (.toByteArray bs)] (printf "%02x " b)) (println))
;; => 92 a3 7e 23 27 2a
;; which is a quoted value, I'd like it to be the single byte 0x2a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions