Configurable JSON serialization/deserialization
hovi opened this issue · 5 comments
Is there way to configure the serializer? I see this library is using newtonjson.
In my case I'd like to set NullValueHandling = NullValueHandling.Ignore
for data response objects.
Off the top of my head, I think anything you annotate on your own models works.
There may be a serializer settings you can access. If not then we should add one.
I just looked, and it's not exposed yet in the main branch.
If you give me a lead, I might try to make a PR. C# is not my strong language though.
@hovi Sure thing.
The main place to start would be in JsonRpcProcessor.cs
Fuctions Process
wrap calls to ProcessInternal
. Those would be where you would add the JsonSerializerSettings optional parameter.
Then there are a handfull of places the method could return if there are errors, so any call to JsonConvert.SerializeObject
would be where the JsonSerializerSettings
get passed.