Viene visualizzato un errore di GSON durante il tentativo di JSON unmarshal in un oggetto. L'errore (previsto BEGIN_OBJECT ma era STRING alla riga 3 colonna 22) punta alla riga 3 dell'ingresso di seguito.GSON: Previsto BEGIN_OBJECT, ma era STRING
Non ho mappato correttamente il JSON rispetto al bean?
import javax.xml.bind.JAXBElement;
public class BusinessPartnerCreate {
protected JAXBElement<String> partnerType;
protected Person person;
protected Company company;
protected String email;
protected String phone;
protected AddressData addressData;
protected AddressClean addressClean;
protected String city;
protected String state;
protected String zipCode;
protected JAXBElement<String> externalId;
}
E il mio ingresso JSON aspetto è questo:
{
"business-partner-create": {
"partner-type": "1",
"person": {
"firstName": "Dirk",
"lastName": "Wintermill",
"title": ""
},
"email": "[email protected]",
"phone": "219-385-2946",
"addressClean": {
"house-number": "10218",
"street-name": "Park",
"street-abbr": "Rd"
},
"city": "Somerset",
"state": "NJ",
"zip-code": "01955"
}
}