com.fasterxml.jackson.databind.exc.InvalidTypeIdException

46 Views Asked by At

i generated POJO class from Claim Cloud API and created restConfiguration to expose an API from Integration Gateway App by using those POJO classes. I constructed a payload to create a new contact from the Integration Gateway App. in my request i setting the correct contactSubtype as Person but getting the following exception when unmarshallProcessor validating the request payload based on RestDefinition.

"contactSubtype" : "Person",

Exception com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'ClaimContact_Person' as a subtype of com.guidewire.model.cloudapi.claim.ClaimContact: Class com.guidewire.model.cloudapi.claim.ClaimContactPerson not subtype of com.guidewire.model.cloudapi.claim.ClaimContact at [Source: (ByteArrayInputStream); line: 56, column: 28] (through reference chain: com.guidewire.model.service.InboundRequest["claimContact"])

In ClaimContact POJO class i see correct @annotation are defined. does anyone has any recommendation on how to set the subtype correctly for Integration Gateway Apps?

**@JsonIgnoreProperties(
  value = "contactSubtype", 
  allowSetters = true 
)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "contactSubtype", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = ClaimContactPerson.class, name = "Person")
{)**
0

There are 0 best solutions below