1

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

rocky
  • 7,506
  • 3
  • 33
  • 48
prabu d
  • 11
  • 2

1 Answers1

0

I assume you are using direct call without using the SDK.

The image resolution was added to the delivery response on April 24th, 2019.

With this enhancement, you can, for example, render placeholders for images in your application before the assets themselves are loaded.

Simply007
  • 444
  • 3
  • 14
  • I can't get your point 'I assume you are using direct call without using the SDK'.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 – prabu d Jul 17 '19 at 11:09
  • Ahh ok I see - you are using [Java SDK](https://github.com/Kentico/delivery-sdk-java) - the problem is that dimensions are currently not declared in the [Asset model](https://github.com/Kentico/delivery-sdk-java/blob/master/delivery/src/main/java/com/kenticocloud/delivery/Asset.java) I have submitted an [issue](https://github.com/Kentico/delivery-sdk-java/issues/82) for that - you could keep track it there. – Simply007 Jul 19 '19 at 11:31