You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Guids serialized as strings even though the compatibility option is set to None #270
so, the binary array representing the GUID has been serialized as a string of 15 characters (0xb0). My expectation was that because I used PackerCompatibilityOptions.None the byte array for GUID will be serialized as bin8 family (0xc4).
Looking at the code it seems that binX family is never considered when packing raw values. I would like to understand why this is the case and how raw values are typically unpacked if the language does not have strong type system (e.g. in JavaScript this GUID will be unpacked as string - is it then the user's responsibility to extract bytes?)
Raw bytes should be unpacked as 'bytes which MAY be UTF-8 encoded string' because there were no binX famaliy in past. I think it is application's responsibility to specify the raw value is truly string or not.
So to recap, the built-in Guid serializer could/should use the binX family if the user passes PackerCompatibilityOptions.None.
I came to the same conclusion. If the language does not have a strong type system or the client does not have a type that corresponds to the server type, the user/developer is the only one who knows how to interpret the data. If this is hard they might need to work around it, possibly, by using a different type.
Activity
yfakariya commentedon Nov 5, 2017
Thank you for feedback. There are two considerations about it.
PackerCompabilityOptions(msgpack-cli/src/MsgPack/Serialization/DefaultSerializers/DefaultSerializers.cs
Line 323 in 4586454
moozzyk commentedon Nov 5, 2017
PackerCompatibilityOptions.None.yfakariya commentedon Nov 6, 2017
I recognized that there are same bug for some other types. I will fixed it for next release (maybe RC)
Add unit test cases for issue #270
Fix built-in Guid and BigInteger serializer do not honor PackerCompat…
Fix existing test cases due to #270.
Add unit test cases for issue #270
Fix built-in Guid and BigInteger serializer do not honor PackerCompat…
Fix existing test cases due to #270.
Add unit test cases for issue #270
Fix built-in Guid and BigInteger serializer do not honor PackerCompat…
Fix existing test cases due to #270.
Add unit test cases for issue #270
Fix built-in Guid and BigInteger serializer do not honor PackerCompat…
Fix existing test cases due to #270.
Add unit test cases for issue #270
Fix built-in Guid and BigInteger serializer do not honor PackerCompat…
Fix existing test cases due to #270.
Add unit test cases for issue #270
Fix built-in Guid and BigInteger serializer do not honor PackerCompat…
Fix existing test cases due to #270.