I'm using the custom JsonSerializer as mentioned in the Readme file in the RestSharp package.
Up until now I added the custom serializer to each request:
RestRequest request = new RestRequest("scans", Method.POST);
request.JsonSerializer = new MyCustomJsonSerializer();
But the read me file mentained I can add it straight to the restclient:
There is one breaking change: the default JsonSerializer is no longer compatible with Json.NET. To use Json.NET for serialization, copy the code from https://github.com/restsharp/RestSharp/blob/86b31f9adf049d7fb821de8279154f41a17b36f7/RestSharp/Serializers/JsonSerializer.cs and register it with your client:
var client = new RestClient();
client.JsonSerializer = new YourCustomSerializer();
I can't find this property in the RestClient class...
Is it a mistake in the ReadMe file? or the package didn't get updated? Is there another way to add the custom serializer instead of adding it to each request?
There was a mistake in the Readme, it seems.
https://github.com/restsharp/RestSharp/issues/886 https://github.com/restsharp/RestSharp/issues/947
This is how it should be used:
Source: https://github.com/restsharp/RestSharp/blob/4e239eaa90abcc699f875bbd7a64efe76a995771/readme.txt