Error with creating JSON object.
I am trying to deserialize a JSON file. I created the file myself. I am getting this error when I try to deserialize it. I am able to read the file as normal and output its contents, but when I try to create an object from it, it errors out. There are no "/" in the file.
This is my call. It errors out on the second line.
This is the object class.
This is an example of my JSON.
3 Replies
That json is not a List<Move>
Ero#1111
REPL Result: Success
Console Output
Quoted by
<@!542772576905199626> from #help-0 (click here)
Compile: 725.784ms | Execution: 137.506ms | React with ❌ to remove this embed.
Oh, I think I understand. So I would need to remove the
moves:
statement at the beginning to make it into a List?
The moves
word only occurs at the very beginning. I thought that was needed, but I guess the class itself or moreso the deserializer decides the type.
That was it. The error was because I was reading the string name of the filepath. That explains the "/" error. After removing the Moves :
and an extra set of brackets, it parsed. Thank you.