/Jackson

Jackson JSON Deserialization – UnrecognizedPropertyException

Whats the Problem? I ran into a UnrecognizedPropertyException today trying to deserialize the following JSON. { "Places": [{ "PlaceId": "LOND-sky", "PlaceName": "London", "CountryId": "UK-sky", "RegionId": "", "CityId": "LOND-sky", "CountryName": "United Kingdom" }, { "PlaceId": "LHR-sky", "PlaceName": "London Heathrow", "CountryId": "UK-sky", "RegionId": "", "CityId": "LOND-sky", "CountryName": "United Kingdom" }] } The Places model was defined as import lombok.Getter; import lombok.Setter; @Setter @Getter public class Places { private List<Place> places; } and the Place model was defined as import lombok.Getter; import lombok.Setter; import lombok.ToString; @Getter @Setter @ToString public class Place { String placeId; String placeName; String countryId; String regionId; String cityId; String countryName; } I was using [...]

By |2019-11-26T08:28:30+00:00November 26th, 2019|Jackson, JSON|0 Comments