-
-
Notifications
You must be signed in to change notification settings - Fork 159
Closed
Labels
Description
Description
The problem is on this line
var bodyJToken = JToken.Parse(requestBody); |
When using DateTimeOffset type and using JToken.Parse, it is converted to DateTime (so it is modified) as it is hardcoded as a standard behavior, see:
JamesNK/Newtonsoft.Json#862
(it is closed, but still unresolved for JToken.Parse)
Solution is change JToken.Parse to JToken.Load with StringReader and set option DateParseHandling = DateParseHandling.None; (default is DateTime). It is described here:
JamesNK/Newtonsoft.Json#862 (comment)
This issue solved global datetimeoffset destroying data, beacuse there is no option to pass another settings to JToken.Parser to override this default.
Environment
- JsonApiDotNetCore Version 3.1