Skip to content

Commit

Permalink
fix: errors when reloading auto generated config (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
qstage authored Jan 30, 2025
1 parent 44d3c51 commit e99d27c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ public static class PluginConfigExtensions
{
private static readonly JsonSerializerOptions _jsonSerializerOptions = new()
{
WriteIndented = true
WriteIndented = true,
ReadCommentHandling = JsonCommentHandling.Skip
};

public static JsonSerializerOptions JsonSerializerOptions => _jsonSerializerOptions;
Expand Down Expand Up @@ -62,7 +63,7 @@ public static class PluginConfigExtensions

var configContent = File.ReadAllText(configPath);

var newConfig = JsonSerializer.Deserialize<T>(configContent)
var newConfig = JsonSerializer.Deserialize<T>(configContent, JsonSerializerOptions)
?? throw new JsonException($"Deserialization failed for configuration file '{configPath}'.");

foreach (var property in typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public))
Expand Down

0 comments on commit e99d27c

Please sign in to comment.