Hi,
I need to covert the following snippet of JSON response to its relevant object. The key is ComponentType not componentType which didnt adhere to java variable standards.
{
"ComponentType": "APC_Ups",
"servers": [
"APC01"
]
}
Object coversion by Jackson failed with error com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field “ComponentType”
Jackson tries to search for the variable name as per java variable naming standards. As there is no variable defined as ‘componentType’, it fails. Defining right variable name using @JsonProperty will solve this problem!
@JsonProperty (“ComponentType”)
String ComponentType;