I searched for qaru before publishing, but there were no solutions for Jackson.
Here is the server response:
{ "ok": true, "result": [ { "update_id": 489881731, //rest }, { "update_id": 489881732, //rest } ] }
As you can see, the "result" property is an array.
Now this is another answer:
{ "ok": true, "result": { "id": 211948704, "first_name": "ربات ادمینهای تلگرام", "username": "tgAdminsBot" } }
Here "result" is one object.
This is my class, I want to deserialize the content. I wrote a custom deserializer for TObject , of course:
public class Result { private TObject[] result; private boolean ok; public void setOk (boolean ok) {
Therefore, I suggested in my class that " result" is an array of TObject s. Now what can I do? Uses @JsonProperty("result") for two fields, one of which is a TObject array and one is a single TObject OK?
If not, what else can I do?
source share