I’m using @mythz’s ServiceStack.Text (package version 2.9) TypeSerializer for serialization and deserialization to deep-copy objects in a cache. I find myself getting this error on deserialization:
Type definitions should start with a ‘{‘, expecting serialized type
‘MetadataCollection’, got string starting with: []
Where MetadataCollection is our custom collection class that implements IEnumerable. I look at the serialized string for my test, and the Metadata property (type MetadataCollection) property on my serializer is indeed serialized as:
,Metadata:[],
Which seems correct to me, since this collection is empty. Is there something I can do to make this work?
This is due to a bug/missing feature in ServiceStack.Text package version 2.x. I upgraded to ServiceStack.Text package version 3.9.3 and all is well.