I know this may be simple. However, I just can\'t get it to work.
So I am trying to use Spring RestTemplate to map my JSON data. I have following JSON response from a re
I ran into the same issue. Annotate with @JsonProperty
:
@JsonIgnoreProperties(ignoreUnknown = true)
public class Data implements Serializable {
@JsonProperty("Name")
private String name;
@JsonProperty("Address")
private String address;
// getters / setters for name and address
}
The fields of your Data
class should now get populated, and you can name your fields independent of the JSON representation (e.g. name
instead of Name
).