I have a model that I serialised using Json.NET, however, when I de-serialise, I get an error when it attempts to parse a Version
type property.
The serialised JSON is below:
{
"Releases": [
{
"Id": "01GPM6T600TCF9NJXXG6WHPSZP",
"Description": "Description",
"InformativeVersion": "v320",
"InformativeReleaseDate": "2024-05-17T00:00:00",
"Version": {
"Major": 320,
"Minor": 0,
"Build": 0,
"Revision": -1,
"MajorRevision": -1,
"MinorRevision": -1
},
"BinaryUrl": "",
"BinarySha256": ""
},
{
"Id": "01GMKTW700BGT0YHN99T1GXS6P",
"Description": "Description",
"InformativeVersion": "v309",
"InformativeReleaseDate": "2024-04-03T00:00:00",
"Version": {
"Major": 309,
"Minor": 0,
"Build": 0,
"Revision": -1,
"MajorRevision": -1,
"MinorRevision": -1
},
"BinaryUrl": "",
"BinarySha256": ""
}
]
}
The error I get is below:
Newtonsoft.Json.JsonSerializationException: 'Unexpected token or value when parsing version. Token: StartObject, Value:. Path 'Releases[0].Version', line 8, position 18.'
Any idea on how to go about resolving this error is appreciated.
1