I've got an response from API which I want to get data from. How am I able to map this response to object by RestTemplate but without getting all the fields? I dont want to create nested objects. I'd expect to get result like this:
@JsonProperty("id")
private long id;
@JsonProperty("user.userName") <-- how to achive this?
private String userName;
@JsonProperty("imagies.thumbnail.url") <-- how can i get only this 1 property?
private URL standardResolutionUrlOfPhoto;
Response:
 "data": [
        {
            "id": "xxxxx",
            "user": {
                "username": "xxxxx"    <--- I dont want  to create User user field!
            },
            "images": {
                "thumbnail": {
                    "width": 150,
                    "height": 150,
                    "url": "xxxxxx"
                },
                "low_resolution": {
                    "width": 320,
                    "height": 320,
                    "url": "xxxxx"
                },
                "standard_resolution": {
                    "width": 640,
                    "height": 640,
                    "url": "xxxx"
                }
            },
 
     
    