Replace Json.Net with System.Text.Json#253
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.
I am assuming these options and comment are no longer applicable?
There was a problem hiding this comment.
yes, the default behavior of System.Text.Json is replace, and ignore doesn't work well as my comment before.
close #252