I'm trying to deserialize a json with the following structure
{
header: {
type: "esummary",
version: "0.3"
},
result: {
22807455: {
uid: "22807455",
pubdate: "2012 Jul",
epubdate: "",
},
uids: [
"22807455"
]
}
}
My main class PubmedResponse and the subclass PubmedResultMap is:
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true)
public class PubmedResponse {
@JsonProperty("header")
PubmedHeader header;
@JsonProperty("result")
PubmedResultMap resultMap;
}
@Getter
@Setter
@JsonIgnoreProperties
public class PubmedResultMap implements PubmedInfo{
Map<String, PubmedResult> results;
@JsonProperty("uids")
List<String> uids;
}
However, the PubmedResultMap can't deserialize the Map starting with 22807455
and in the json I don't have a property to map to my attribute in that class. Does anyone faced that problem before.? This is the full json https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=22807455&retmode=json