-
-
Notifications
You must be signed in to change notification settings - Fork 455
Replace Json.Net with System.Text.Json #253
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
Conversation
|
hey @taooceros have you tested this new serializer working with settings and our default plugins? |
|
Yes, I have tested with default plugin and the setting, and found one issue. Originally, Json.Net will use ignore null value to load setting.json, while System.Text.Json doesn't successfully load that with the setting, but successfully load it without ignore null value. |
|
It seems work fine. |
| // use property initialization instead of DefaultValueAttribute | ||
| // easier and flexible for default value of object | ||
| _serializerSettings = new JsonSerializerSettings | ||
| _serializerSettings = new JsonSerializerOptions | ||
| { | ||
| ObjectCreationHandling = ObjectCreationHandling.Replace, | ||
| NullValueHandling = NullValueHandling.Ignore | ||
| IgnoreNullValues = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming these options and comment are no longer applicable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the default behavior of System.Text.Json is replace, and ignore doesn't work well as my comment before.
close #252