I've written a file JSON with the information that I need to use to create an array
This is the json that I'm using
[{
"matr": [0,0],
"room": "b",
"door": true,
"respawnPoint": false
},
{
"matr": [0,1],
"room": "b",
"door": false,
"respawnPoint": false
},...
]
and this is how I try to de-serialize it with java
String path="src/main/resources/room.json";
JsonReader reader= new JsonReader(new FileReader(path));
SupportPosition[] a=new Gson().fromJson(path,
SupportPosition[].class);
but this error appears
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $