This library modifies JsonConvert.DefaultSettings. For example in this commit: https://github.com/Azure/azure-iot-sdk-csharp/commit/c1d6e97ab28b6dd1fccd9ad2fad881dc5d906488. In our case we have previously depended on using our own default settings for a lot of other things. Upgrading the DeviceClient means we have to manually specify the settings everywhere we serialize or deserialize anything now.
It doesn't feel correct to modify a global static from a library where the application using the library may previously depend on it.
Code sample exhibiting the issue
We use these settings by setting the DefaultSettings when configuring our app:
new JsonSerializerSettings
{
Formatting = Formatting.Indented,
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
When doing the following after creating the device client:
var messageContent = JsonConvert.SerializeObject(new { Test = "test" }, Formatting.None);
it's not using our settings, but it seems like it's rather settings being set by this library.
Description of the issue
This library modifies JsonConvert.DefaultSettings. For example in this commit: https://github.com/Azure/azure-iot-sdk-csharp/commit/c1d6e97ab28b6dd1fccd9ad2fad881dc5d906488. In our case we have previously depended on using our own default settings for a lot of other things. Upgrading the DeviceClient means we have to manually specify the settings everywhere we serialize or deserialize anything now.
It doesn't feel correct to modify a global static from a library where the application using the library may previously depend on it.
Code sample exhibiting the issue
We use these settings by setting the DefaultSettings when configuring our app:
When doing the following after creating the device client:
it's not using our settings, but it seems like it's rather settings being set by this library.