my string is:
"[{"property":"surname","direction":"ASC"}]"
can I get GSON to deserialise this, without adding to it / wrapping it?
Basically, I need to deserialise an array of name-value pairs.
I’ve tried a few approaches, to no avail.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You basically want to represent it as List of Maps:
Output:
If the objects in your array contain a known set of key/value pairs, you can create a POJO and map to that: