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 clickin

JamesNK / Newtonsoft.Json Public

submited by
Style Pass
2021-10-19 15:00:25

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.

But I find it dangerously surprising that by default Json.NET interprets strings as dates (let alone the performance issues this inevitably brings with it).

Seems like JsonConvert.DefaultSettings would allow to globally override this behavior: http://james.newtonking.com/archive/2013/05/08/json-net-5-0-release-5-defaultsettings-and-extension-data

I suppose this is for convenience. We in our project do use this behavior because that way dates are human readable. On other hand MS Dates ( /Date(1224043200000)/ ) are not.

Deserializing a string to a string should not arbitrarily change the string. That really sounds like a bug to me, possibly a design bug. I'm not expecting breaking changes to be introduced to fix this, of course; I'm just interested in hearing the auhor's opinion on this. We found a workaround and that's good enough for us right now.

Leave a Comment
Related Posts