Hangfire icon indicating copy to clipboard operation
Hangfire copied to clipboard

Remove Newtonsoft and integrate Microsofts System.Text.Json library

Open montelyno opened this issue 1 year ago • 6 comments

Hi all, first of all thank you very much for your great work! Highly appreciated!

Is there any option to remove Newtonsoft.Json and integrate the implementation from Microsoft in System.Text.Json? We are removing the old serializer where ever possible and strictly use the new implementation, less dependencies and industry code scanners like FoD are more relaxed...

Thanks in advance for your effort and kind regards Michael

montelyno avatar Oct 11 '23 08:10 montelyno

Perhaps there is another way of reformulating this request: redesign the next version of Hangfire to refactor the serialization (what is now SerializationHelper into a pluggable component. which can be implemented using whatever serialization mechanism you like.

Because today, it's System.Text.Json, but what will it be tomorrow?

Of course, there is more to it than that: Hangfire contains references to Newtonsoft-specific attributes in various other places.

  • Some of those can be renamed to .NET attributes that are also recognized by Newtonsoft. For example NonSerialized instead of JsonIgnore, DataMember instead of JsonProperty.
  • Other places will need some serious thinking.... that's why the version will most likely be bumped to 2 :-).

Oh if I only had the time...

vvdb-architecture avatar Oct 12 '23 06:10 vvdb-architecture

Because today, it's System.Text.Json, but what will it be tomorrow?

But Newtonsoft is a live project, I think it will be going on for a long time still.

sabiland avatar Oct 12 '23 06:10 sabiland

Sounds like a good 2.0 goal!

Relates/Dupes to https://github.com/HangfireIO/Hangfire/issues/2202 https://github.com/HangfireIO/Hangfire/issues/2033

supergibbs avatar Nov 22 '23 00:11 supergibbs

+1

apavelm avatar Dec 22 '23 08:12 apavelm

is a requested feature in the roadmap?

apavelm avatar Dec 22 '23 13:12 apavelm

+1

lisandrogreco avatar Jan 08 '24 14:01 lisandrogreco