aspnet / JsonPatch

[Archived] JSON PATCH library. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
103 stars 48 forks source link

Patching of readonly collections fails #118

Closed MovGP0 closed 6 years ago

MovGP0 commented 7 years ago

Given I have an Entity with an readonly collection like this:

public sealed class MyEntity 
{
    public MyEntity()
    {
    }

    [JsonConstructor]
    public MyEntity(IEnumerable<string> tags)
    {
        Tags = tags?.ToList() ?? new List<string>();
    }

    [JsonProperty("tags")]
    public ICollection<string> Tags { get; } = new List<string>();
}

Than it is not possible to patch it, besides the property beeing potentially writeable and also serializeable.

aspnet-hello commented 6 years ago

This issue was moved to aspnet/Home#2427