Support `struct` types
ChristophLindemann opened this issue · 0 comments
ChristophLindemann commented
Currently struct
and readonly struct
can not be serialized/deserialized without writing a specific converter.
The ObjectConverter
class is constrained to where T : class. So even if you write you own generic struct converter, deserialization does not work with the DiscriminatorConvention as it expects to get an IObjectConverter<T>
:
Dahomey.Cbor/src/Dahomey.Cbor/Serialization/Converters/ObjectConverter.cs
Lines 277 to 290 in 527b72f
But IObjectConverter<T>
is restricted to class