Skip to content

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

@StevenTCramer

Description

@StevenTCramer

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);
    }

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions