Skip to content

Non-string map keys #376

Answered by danielaparker
ecorm asked this question in Q&A
Discussion options

You must be logged in to vote

It's supported at the lowest levels. At the lowest levels, keys can be any value, including object and array. Specifically, the push parsers basic_cbor_parser and basic_msgpack_parser write parse events to a basic_json_visitor2, which receives key-value pairs as a pair of values rather than a key and a value. Higher levels, though, use an adaptor to adapt the basic_json_visitor2 to a basic_json_visitor for parsing. The adaptor receives object members as a pair of values, serializing the first value to a string, and outputs them as a string key and a value. So currently, if you needed the non-stringified key, you would need to work at the level of basic_json_visitor2.

Currently our pull re…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ecorm
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants