I want to map following json to a pojo using jackson.
{
"colors": {
"red": {
"colorCode": "#FF0000"
},
"green": {
"colorCode": "#00FF00"
},
"blue": {
"colorCode": "#0000FF"
}
}
}
Is there any possible way to create a single POJO without having to create POJOs for each color because every color contains same parameter(colorCode)?
Note: I tried using @jsonAlias but it wont work because it overwrites that parameter.