Spring: RestTemplate returns null object
Assuming you're using Jackson, RestTemplate
automatically registers a MappingJackson2HttpMessageConverter
which configures the underlying ObjectMapper
to ignore unknown properties.
The JSON object has a single attribute named userRegistrations
, whereas your Java class has a single attribute named userRegistrationList
. They don't match.
They need to match, or you need to add a @JsonProperty
annotation of the attribute to make Jackson serialize/parse it as userRegistrations
.