There is a lot information at stackoverflow about how to deserialize a json array using Gson.
But how can I do the same using XStream
with jettison?
Here is json:
{"entity":[{"id":"1", "name":"aaa"}, {"id":"2", "name":"bbb"}]}
Here is XStream
code how I try to parse it:
XStream xstream = new XStream(new JettisonMappedXmlDriver());
xstream.alias("entity", Entity[].class);
return (Entity[])xstream.fromXML(jsonString);
I have following exception:
com.thoughtworks.xstream.converters.ConversionException: id : id