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
I am using YamlDotNet to deserialize a yml file into a custom object. For certain strings I'd like to append some prefix on the result.
For example, my custom class is:
class Metadata {
public string Path {get; set; }
}
and my YML has:
path: image.jpg
and I want to append a given relative path so that when a path value is found it will be modified resulting in myMetadata.Path // /myPrefix/image.jpg when deserializing.
Something like .WithAttributeOverride but for values would be ideal. But I suspect I should do something with a custom Type converters although documentation at https://github.com/aaubry/YamlDotNet/wiki/Serialization.TypeConverters is empty and I couldn't manage to have anything working.
Any guide on whether this is possible would be much appreciated. Cheers!
The text was updated successfully, but these errors were encountered:
I am using YamlDotNet to deserialize a yml file into a custom object. For certain strings I'd like to append some prefix on the result.
For example, my custom class is:
and my YML has:
and I want to append a given relative path so that when a path value is found it will be modified resulting in
myMetadata.Path // /myPrefix/image.jpg
when deserializing.Something like
.WithAttributeOverride
but for values would be ideal. But I suspect I should do something with a custom Type converters although documentation at https://github.com/aaubry/YamlDotNet/wiki/Serialization.TypeConverters is empty and I couldn't manage to have anything working.Any guide on whether this is possible would be much appreciated. Cheers!
The text was updated successfully, but these errors were encountered: