I have a method with a restTemplate call like this:
restTemplate.getForObject(apiUrl ,Someclass.class);
Someclass.class:
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Imp implements Serializable {
@JsonProperty("Id")
private String Id;
@JsonProperty("ReportId")
private String ReportId;
@JsonProperty("Title")
private String Title;
@JsonProperty("Name")
private String Name;
@JsonProperty("Uri")
private String Uri;
}
The API returns an array, and the error i'm receiving is:
org.springframework.web.client.RestClientException: Error while extracting response for type [class ...] and content type [application/json;charset=utf-8]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of com...
out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of com...
out of START_ARRAY token
Which restTempalte method shoud i use to get proper api response?, or where is the problem?.thanks!
>); An expression is expected, pointed by the IDE...
– Guille Nov 26 '18 at 16:31