elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
6.38k stars 1.18k forks source link

IEndpointContentSerializerSettingsProvider should support System.Text.Json #4403

Open liuliang-wt opened 1 year ago

liuliang-wt commented 1 year ago

My .netcore app is using System.Text.Json as the default serializer, when integrate with Elsa which use NewtonSoft.json, my app will broke because I have many custom converter for System.Text.Json.

I read Elsa's souce code, I found this IEndpointContentSerializerSettingsProvider may solve my problem, but this interface declares this method : JsonSerializerSettings GetSettings(); It should return Object, so that when I set the system to use System.Text.Json, I can inject this Interface using System.Text.Json.JsonSerializerOptions.

sfmskywalker commented 1 year ago

Hi @liuliang-wt,

I've reviewed the issue you opened regarding the IEndpointContentSerializerSettingsProvider and its support for System.Text.Json. I understand your concern about integrating Elsa with applications that use System.Text.Json as the default serializer, especially when there are custom converters in place.

I'm not sure how changing the serializer settings for Elsa API endpoints will solve the issue, because if you modify these settings, it might potentially break the designer. However, I appreciate your insights and suggestions on the matter. If you believe you have a solution that can seamlessly integrate both serializers without causing disruptions, you're welcome to try and submit a PR. We're always open to contributions that can enhance the functionality and compatibility of Elsa.

Thank you for bringing this to our attention.

liuliang-wt commented 1 year ago

I submitted a pr #4430 , take a look please