I have done a simple code to retrieve published content from Kentico cloud.I am using Inbuilt classes/Code given by Kentico cloud to retrieve. While retrieving I am getting the following exception.
"timestamp": "2019-07-15T14:05:11.645+0000",
"status": 500,
"error": "Internal Server Error",
"message": "com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field \"width\" (class com.kenticocloud.delivery.Image), not marked as ignorable (3 known properties: \"description\", \"image_id\", \"url\"])\n at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.kenticocloud.delivery.ContentItemsListingResponse[\"items\"]->java.util.ArrayList[0]->com.kenticocloud.delivery.ContentItem[\"elements\"]->java.util.LinkedHashMap[\"section\"]->com.kenticocloud.delivery.RichTextElement[\"images\"]->java.util.LinkedHashMap[\"dd2f48ec-252a-41b9-badf-320c8d125c16\"]->com.kenticocloud.delivery.Image[\"width\"])",
It is happening due to unrecognized property in the Json Response. This is the unexpected reponse I am getting.
"leader_image": {
"type": "asset",
"name": "Leader Image",
"value": [
{
"name": "KemperKip_Rabobank_header.jpg",
"description": null,
"type": "image/jpeg",
"size": 500407,
"url": "https://assets-us-01.kc-usercontent.com:443/c6e7ef22-97ac-008a-8a75-a65bfc508501/4ecbfb36-60a6-49c7-a4a1-e8c5ad964a9a/KemperKip_Rabobank_header.jpg",
"width": 3348,
"height": 1874
}
]
},
Here width
and height
parameters are not mentioned in the mapping class.
I am using the following code snippets from Kentico cloud site DeliveryClient client = new DeliveryClient("975bf280-fd91-488c-994c-2f04416e5ee3", ""); ContentItem item = client.getItem("on_roasts").item;
Can you please provide the updated maven dependency version.I am using this version
com.kenticocloud delivery 2.0.2