couchdb-net icon indicating copy to clipboard operation
couchdb-net copied to clipboard

Use of System.Text.Json

Open dmrayt opened this issue 4 years ago • 4 comments

Hi! Is there some plan to support System.Text.Json?

For Flurl, it's already possible with https://github.com/YellowLineParking/Appy.Flurl.

dmrayt avatar Sep 27 '21 15:09 dmrayt

Hi, no plan for it yet. I would like to keep Newtonsoft option available so people don't need to change their code too much. I haven't researched it yet

matteobortolazzo avatar Sep 27 '21 19:09 matteobortolazzo

I didn't mean to replace Newtonsoft but add support for System.Text.Json as an option.

I don't know how much you use from Newtonsoft but the first step could be to use attributes from both library in your models. e.g:

  [System.Text.Json.Serialization.JsonPropertyName("_rev")]
  [Newtonsoft.Json.JsonProperty("_rev")]
  public string Rev { get; set; }

dmrayt avatar Sep 28 '21 07:09 dmrayt

That's technically true, but I dont want to have both libraries there. I want NewtonSoft one to be optional with a second NuGet package. But I want to move to System.Text.Json as well

matteobortolazzo avatar Oct 12 '21 20:10 matteobortolazzo

So I did a bit of research, even if I want to implement System.Text.Json, it will take a huge amount of work. The NetwonSoft is used everywhere from deserialization of internal classes to options.

So I will keep this here not there will no updates in the near future

matteobortolazzo avatar Oct 14 '21 20:10 matteobortolazzo