Can someone show me how to deserialize an EnumSet (presumably using EnumSetDeserializer)? Serialize works as expected, but deserialize fails in the face of type erasure. I can't find an example anywhere ... yet the class EnumSetDeserializer is there.
Perhaps you can't do it for a "standalone" "root" EnumSet but it does work (somehow) for an EnumSet which is a property of a class which you are serializing instead?
For this purpose the EnumSet is instantiated at a fixed type, e.g., it will always be EnumSet<Foo> for some enum type Foo, either standalone or as a property in a containing class. So a solution which doesn't need type metadata written to the JSON would be extra nice (though a solution which does have type metadata written to the JSON is ok I suppose).
(I know how to finesse the issue by using an array instead, as arrays don't suffer type erasure, but the property type is more naturally a set ... and the class EnumSetDeserializer is there ...)
Thanks! -- David