Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid setting JsonConvert.DefaultSettings #334

Closed
mgreen opened this issue Sep 29, 2022 · 2 comments
Closed

Avoid setting JsonConvert.DefaultSettings #334

mgreen opened this issue Sep 29, 2022 · 2 comments

Comments

@mgreen
Copy link

mgreen commented Sep 29, 2022

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.

// This makes sure date values are consistently parsed exactly as they appear.
// Default behavior auto formats date values.
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
{
DateParseHandling = DateParseHandling.None,
};

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

@llawwaii
Copy link
Contributor

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.

@dingbx
Copy link
Collaborator

dingbx commented Jan 24, 2023

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

@dingbx dingbx closed this as completed Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants