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
EnsureRoundtrip emits tags for objects when needed. But it does not force emission of tags for primitives.
For example the class
classContainer{publicobjectData{get;set;}=123L;}
will be deserialized as string "123".
I could bypass the problem by appending a custom ChainedEventEmitter after the TypeAssigningEventEmitter.
However It was still not possible to properly deserialize the container when data was assigned an instance of System.Type. For example container.Data = typeof(long) is deserialized also as string because the SystemTypeConverter bypassed the ChainedEventEmitter and also does not emit a tag:
I'd suggest to add a method like WithSystemTypeTagPrefix(string) to the serialization builder classes and always emit tags when the runtime type is not equal to the declared type.
The text was updated successfully, but these errors were encountered:
EnsureRoundtrip emits tags for objects when needed. But it does not force emission of tags for primitives.
For example the class
will be deserialized as string "123".
I could bypass the problem by appending a custom
ChainedEventEmitter
after theTypeAssigningEventEmitter
.However It was still not possible to properly deserialize the container when data was assigned an instance of System.Type. For example
container.Data = typeof(long)
is deserialized also as string because the SystemTypeConverter bypassed the ChainedEventEmitter and also does not emit a tag:YamlDotNet/YamlDotNet/Serialization/Converters/SystemTypeConverter.cs
Line 30 in 5ec2dd7
I'd suggest to add a method like
WithSystemTypeTagPrefix(string)
to the serialization builder classes and always emit tags when the runtime type is not equal to the declared type.The text was updated successfully, but these errors were encountered: