JSON parse error: Unrecognized field “xxxx“ (classxxxx.xxx.xxx.xx JSON type

User
JSON parse error: Unrecognized field "imPremodelCode" (class com.immotors.campaign.pojo.dto.res.SlcCommonResDTO$DataSetDTO$MainLeadsDTO), not marked as ignorable; nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "imPremodelCode" (class com.immotors.campaign.pojo.dto.res.SlcCommonResDTO$DataSetDTO$MainLeadsDTO), not marked as ignorable (57 known properties: "interestPoint", "smallChannelCode", "angelPoint", "premodelName", "collectTime", "purchaseCityCode", "districtCode", "email", "financePlan", "dealerCode", "smallChannelName", "education", "position", "userLastName", "postCode", "mainLeadId", "csopLevel", "updateTime", "purchaseCityName", "activityName", "vehicleBrand", "vehicleOwnerOption", "provinceCode", "vehicleStatus", "gender", "dealerName", "purchasePlan", "reasonForOwner", "mobileArea", "userFirstName", "imAttractPoint", "communication", "havingBrand", "annualIncome", "createTime", "isIm", "isContinue", "premodelCode", "address", "userName", "cityCode", "fromSystem", "phase", "description", "birthday", "ageRange", "salesCode", "activityCode", "leadStatusValue", "purchaseBudget", "salesName", "isNewEnergy", "leadStatus", "productFault", "intentionLevel", "profession", "company"])
 at [Source: (PushbackInputStream); line: 1, column: 626] (through reference chain: com.immotors.campaign.pojo.dto.res.SlcCommonResDTO["dataSet"]->com.immotors.campaign.pojo.dto.res.SlcCommonResDTO$DataSetDTO["mainLeads"]->java.util.ArrayList[0]->com.immotors.campaign.pojo.dto.res.SlcCommonResDTO$DataSetDTO$MainLeadsDTO["imPremodelCode"])
	at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType

Update JSON:
If you have control over the JSON data, make sure to include only known fields, or update the JSON structure to match the MainLeadsDTOexpected format of the class.

Ignore unknown fields:
If you wish to ignore unknown fields during JSON parsing, you can configure Jackson ObjectMapper to ignore unknown properties. You can MainLeadsDTOadd @JsonIgnoreProperties(ignoreUnknown = true)annotations on the class, or configure ObjectMapper directly.

Modify the class definition:
If the "imPremodelCode" field is indeed a valid field that should be included in MainLeadsDTOthe class, you need to add the corresponding attribute in the class definition. Make sure property names match field names exactly, and consider adding any necessary annotations or getter/setter methods.

Guess you like

Origin blog.csdn.net/a203206868/article/details/131575667