CDM icon indicating copy to clipboard operation
CDM copied to clipboard

Avoid setting JsonConvert.DefaultSettings

Open mgreen opened this issue 3 years ago • 1 comments

In PersistenceLayer.cs, the Newtonsoft JsonConvert default settings are overwritten. This is a global default that can break serialization for consumers who are also using JsonConvert and would likely not be expecting this behavior.

https://github.com/microsoft/CDM/blob/9de479beb4b0a223db08f9feff140498d598f333/objectModel/CSharp/Microsoft.CommonDataModel.ObjectModel/Persistence/PersistenceLayer.cs#L142-L147

Instead, one of the JsonConvert overloads accepting a settings object could be used.

mgreen avatar Sep 29 '22 21:09 mgreen

Hi @mgreen, thanks for bringing this to our attention. I have created a task for this issue, and we will provide updates as the changes are made.

llawwaii avatar Sep 30 '22 00:09 llawwaii

The issue is resolved in the latest release. Closing this issue, please reopen if it's still not resovled.

dingbx avatar Jan 24 '23 19:01 dingbx