posted 4 years ago
I have the following REST controller
Without
The code runs fine in the debugger and executes fine with Posman. However, with this addition I am getting the error
java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:351) ~[gson-2.8.6.jar:na]
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80) ~[gson-2.8.6.jar:na]
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61) ~[gson-2.8.6.jar:na]
at com.google.gson.Gson.fromJson(Gson.java:932) ~[gson-2.8.6.jar:na]
at com.google.gson.Gson.fromJson(Gson.java:897) ~[gson-2.8.6.jar:na]
at com.google.gson.Gson.fromJson(Gson.java:846) ~[gson-2.8.6.jar:na]
at com.paperless.controler.PaperlessController.objects(PaperlessController.java:67) ~[classes/:na]
What I am trying to do is create the code for the client, but I am getting this error.
Your help will be greatly appreciated,
Alejandro Barrero