hadashiA/VYaml

YamlSerializerOptions is not updated after the first usage

Closed this issue · 1 comments

It makes custom Formatters is not working all the time. It only works when I input all custom Formatters in YamlSerializerOptions at the first usage of Serialize or Deserialize. Resolver in the YamlSerializerOptions will not change after that.

When using YamlSerializer, deserializationContext and serializationContext will not be updated by YamlSerializerOptions.
deserializationContext and serializationContext are static and the Resolver inside is never updated after the first creation.

The bug is related to the some code like the following in YamlSerializer.cs .
var contextLocal = deserializationContext ??= new YamlDeserializationContext(options);

Your work is great. And it will be perfect if the bug is fixed.

Oh, thanks for the report. FIxed in #79 .