Skip to content

Commit

Permalink
fix(YamlDotNet): Fixed the UriTypeSerializer to properly serialize UR…
Browse files Browse the repository at this point in the history
…I instances (original string vs to string)
  • Loading branch information
cdavernas committed Aug 21, 2024
1 parent 9763af0 commit f566d1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public virtual object ReadYaml(IParser parser, Type type)
public virtual void WriteYaml(IEmitter emitter, object? value, Type type)
{
if (value == null) return;
emitter.Emit(new Scalar(((Uri)value).ToString()));
emitter.Emit(new Scalar(((Uri)value).OriginalString));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ public class YamlSerializer(YamlDotNet.Serialization.ISerializer serializer, IDe
deserializer
.IgnoreUnmatchedProperties()
.WithNamingConvention(CamelCaseNamingConvention.Instance)
.WithNodeTypeResolver(new InferTypeResolver())
.WithNodeDeserializer(
inner => new StringEnumDeserializer(inner),
syntax => syntax.InsteadOf<ScalarNodeDeserializer>())
.WithNodeTypeResolver(new InferTypeResolver())
.WithNodeDeserializer(
inner => new JsonObjectDeserializer(inner),
syntax => syntax.InsteadOf<DictionaryNodeDeserializer>())
Expand Down

0 comments on commit f566d1e

Please sign in to comment.