java - Jackson Databinding -
we using api communicate between our services. bind data use following dependencies:
<dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-core</artifactid> <version>2.6.5</version> </dependency> <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-databind</artifactid> <version>2.6.0</version> </dependency> <dependency> <groupid>com.fasterxml</groupid> <artifactid>jackson-xml-databind</artifactid> <version>0.6.2</version> </dependency>
the old way api offered list me :
country: [ "nl", "be", "es", "gb", ],
normally bind pojos followed: e.g.
@jsonproperty("country") private list<string> countries;
which not causing problems.
now our api being updated , data showed in way example:
registeredin: { datatype: "ss", item: { nl: "nl", be: "be", es: "es", gb: "gb" } },
i need part of information of object:
item: { nl: "nl", be: "be", es: "es", gb: "gb" }
the problem list isn't string list anymore has become list objects has countrycode in it. there easy way still string values list? doing way did annotations?
try using map<string, string>
instead of list<string>
. seems bit redundant use same value key map, should serialize way want to.
Comments
Post a Comment