AnyClone icon indicating copy to clipboard operation
AnyClone copied to clipboard

clone System.Text.Json.Serialization.JsonSerializerOptions throws exception.

Open StevenTCramer opened this issue 6 years ago • 2 comments

trying to clone JsonSerializerOptions in dotnet core 3 throws exception.

JsonNamingPolicy.CamelCase is not an enum but some crazy object.

using System.Text.Json.Serialization;

    public void ShouldCloneJsonSerializationOptions()
    {
      var jsonSerializerOptions = new JsonSerializerOptions
      {
        PropertyNamingPolicy = JsonNamingPolicy.CamelCase
      };

      JsonSerializerOptions clone = jsonSerializerOptions.Clone();
      clone.PropertyNamingPolicy.ShouldBe(JsonNamingPolicy.CamelCase);
    }

StevenTCramer avatar Jun 23 '19 16:06 StevenTCramer

This is being looked at today, I'll follow up when the fix is merged

replaysMike avatar Aug 01 '19 21:08 replaysMike

@replaysMike Any update on this and https://github.com/TimeWarpEngineering/blazor-state/issues/148

I'm pushing out another update to Blazor-State today.

StevenTCramer avatar Aug 17 '19 09:08 StevenTCramer