fiefensneifiefens
Serialization and Deserialization Issues
Ive been trying to get serialization to work for my C# World object, but I'm recieving this error, quite often, but with different lines of course. An example of the error, the JSON it was trying to read, a specific excerpt of it, and more are provided below.
System.Text.Json.JsonException: 'The JSON value could not be converted to System.Collections.Generic.List`1[Lightrealm.District]. Path: $.WorldMap[3766].MyLocation.DistrictsToAdd | LineNumber: 33915 | BytePositionInLine: 27.'
I have some more infomration on my code in the attached text file, including an excerpt of the JSON. I've also attached the entire JSON file, but it is rather massive.
According to some of my research the file structure might not be parseable into a list? No information on how to fix that, or why the program would store it in a different way than it reads. I thought it would, in theory, serialize from the list and then deserialize it back into a list?
If anyone has run into issues like this with deserialization, or knows what I'm doing wrong, I would appreciate the help. I can provide more information if need be. Thank you!
6 replies