conductor-sdk / conductor-csharp

The conductor-csharp repository provides the client SDKs to build task workers in C#
Apache License 2.0
41 stars 16 forks source link

The ApiClient does allow for custom serialization #93

Closed zacrumford closed 8 months ago

zacrumford commented 12 months ago

See this line for details.

There is no way to supply a custom serializer in ApiClient. While there exists the 'serializerSettings' member, there are two issues with this:

  1. this is not use as input to JsonConvert.Serialize() during serialization
  2. the serializerSettings member is private and there is no way of setting it in a constructor.

Additionally, one would think that ApiClient.RestClient.UseSerializer<T> (or the Newtonsoft extension UseNewtonsoftJson) would have an effect but this is completely unused in ApiClient.

Proposed fixes:

  1. Add a ctor to allow overload for serialization settings and use that.
  2. Use the serializer in the RestClient

Note: callers can work around this by configuring newtonsoft's default serializer options but this is error prone and affects the whole process.

amid0 commented 11 months ago

Also faced with serialization issue. In a project used System.Text.Json serialization And after calling start workflow API Got this instead of string values )

image