msgpack-cli
msgpack-cli copied to clipboard
AllowAsymmetricSerializer still doesn't allow non-settable properties to be serialized
https://github.com/msgpack/msgpack-cli/blob/922607e3cbcc0bcef7dd7105dd72325e506a4174/src/MsgPack/Serialization/SerializationCompatibilityOptions.cs#L184-L185
When setting this value to true in PackObject it still doesn't serialize non-settable properties, although the comment seems to say it should.
To be clear, properties with private setters are serialized, but properties with no setters aren't.
The serializer ignores get only properties because it often represents "another expression" of instance of the type such as DateTime.Hour. For compatibility reason, the serializer keep ignoring them even if it is asymmetric.
If you want to serialize such get-only properties, you can use [MessagePackMember] attribute with asymmetric serialization.
Regardless whether you want to do so or not, I will edit the XML doc to clarify this behavior.
Thank you!