2

I am having some issues deserializing a datetime property with JIL. The JSON has been originally serializedby JIL, stored in a database, and now read back out.

The deserializer is throwing an exception of:

Expected: ,, }

Here is the json in question:

[
  {
    "BuildVersion": 0,
    "DataCenterId": "LD5",
    "Heartbeat": 1458060298923,
    "ID": "0393ceb7-92cf-45f6-8cea-ac25878598e3",
    "IsMarkedSoftDeleted": false,
    "IsNew": true,
    "ItemKey": "0393ceb7-92cf-45f6-8cea-ac25878598e3",
    "ItemType": "Node",
    "MajorVersion": 0,
    "MaxAccounts": 25,
    "MinorVersion": 0,
    "Name": "LN-PETER2",
    "OriginalId": null,
    "RunningAccounts": 0,
    "TypeId": "MT4 Client"
  }
]

Heartbeat is the DateTime property, and we have confirmed that by removing it, the JSON deserializes OK.

we are using these options for both the serialize and deserialize:

new Options(dateFormat: DateTimeFormat.MillisecondsSinceUnixEpoch, includeInherited: true);

I have noticed that Sigil has had a few nuget updates this week, not sure if it's related to that or not.

Any ideas?

UPDATE: The class definition is quite long, but the definition for the heartbeat property which is the one that makes or breaks the deserialization is as below:

public DateTime Heartbeat { get; set; }

This is using static deserialization.

Alexei - check Codidact
  • 22,016
  • 16
  • 145
  • 164
GreatSamps
  • 589
  • 1
  • 5
  • 16

0 Answers0