-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
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
Decoding non-string-able-keyed maps #232
Comments
What happens when you use There is not really a reason for msgp to not allow other types as keys seeing as The online editor on https://msgpack.org/ doesn't seem to allow int keys either. You can manually decode it using an extension. This means msgp will pass a raw |
Has anyone figured out how to actually do this (marshalling or unmarshalling a map with non-string keys). The wiki page for custom extensions seems geared towards single, custom types. Not sure how to set the struct tags on a field that is a composite type (which in my case is a type alias for the map composed of my custom type as key and integers as values). Are we supposed to write the custom extension for the map as a whole, or only for the key type? (I did it for the key type but it's not getting picked up by the library when running |
I was going to try to (back then), but never-ending tasks with higher priority don't ever end :) And in the meantime, our CPU bottlenecks shifted a lot, so I have no idea when I'll get to it.. |
such as SeriesSource map[SeriesSourceProperties]uint32 but we need to pass it through in our http requests... i haven't gotten this to work yet. tinylib/msgp#232 (comment) not sure yet how i will solve this
BTW I agree
this could use some expanding. which primitives? custom shims? extensions? on the map level or the key level? can we get an example for both encoding and decoding? thanks. |
Hello.
We have some data that is currently encoded with msgpack/msgpack-python and decoded with vmihailenco/msgpack. I'm trying to switch the decoding to msgp. I've added duplicate decoding code and
reflect.DeepEqual
the results and diffing them when it fails.Where I'm getting with vmihailenco/msgpack:
with msgp I'm getting
TopicIDs: (map[int]bool) <nil>
silently. The docs say map must havestr
orbin
keys, is that right? It also says "You can still manually decode arbitrary maps with the primitives built into the library", but how? So:The text was updated successfully, but these errors were encountered: