In Event class POJO
@JsonProperty("aDocId")
private String aDocId = null;
public String getADocId() {
return aDocId;
}
public void setADocId(String aDocId) {
this.aDocId = aDocId;
}
-------------------------------------------------------------------------------------
While doing a post request,
Event event = (Event) object;
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<Event> entity = new HttpEntity<>(event, headers);
String response = restTemplate.postForObject(url, entity, String.class);
--------------------------------------------------------------------------------------
response says message cannot be accepted as it has unidentified field
As the json getting posted has duplicate fields with different case: aDocId, adocId where as I expected only aDocId as per my Event class.
I could not change anything in the POJO as it is a auto generated class based on swagger.
I am using Spring boot. Seeking for help to resolve this scenario.