Havunen / SystemTextJsonPatch

SystemTextJsonPatch is a JSON Patch (JsonPatchDocument) RFC 6902 implementation for .NET using System.Text.Json
MIT License
102 stars 12 forks source link

[Suggestion] Use JsonConvert attribute by default #18

Closed ling921 closed 1 year ago

ling921 commented 1 year ago

Use JsonConverter attribute with converter or factory on both JsonPatchDocument.cs and JsonPatchDocumentOfT.cs

...
[JsonConverter(typeof(JsonPatchDocumentConverter))]
public class JsonPatchDocument : IJsonPatchDocument
...

...
[JsonConverter(typeof(JsonPatchDocumentConverterFactory))]
public class JsonPatchDocument<TModel> : IJsonPatchDocument where TModel : class
...

If this is done, we don't have to set JsonSerializerOptions.

Havunen commented 1 year ago

Hi, thanks for raising this issue. This is great idea!

Havunen commented 1 year ago

This is now available in the version 2.0.0