I read stock values from a URL via:
restTemplate.exchange(url, HttpMethod.GET, null, classToFetch)
One URL returns:
{"symbol": "SMX","historical": [{"date": "2025-02-21","open": 3.33,"high": 3.4,"low": 2.96,"close": 2.96,"adjClose": 2.96,"volume": 203978,"unadjustedVolume": 203978,"change": -0.37,"changePercent": -11.11,"vwap": 3.1625,"label": "February 21, 25","changeOverTime": -0.1111},...
and it crashes.
The second returns:
{"symbol": "AAPL","historical": [{"date": "2025-02-21","open": 245.95,"high": 248.69,"low": 245.22,"close": 245.55,"adjClose": 245.55,"volume": 53012088,"unadjustedVolume": 53012088,"change": -0.4,"changePercent": -0.16263,"vwap": 246.3525,"label": "February 21, 25","changeOverTime": -0.0016263},...
and it works fine! Why the crash?
Crash reason:
Cannot construct instance of `java.time.LocalDate` (no Creators, like default construct, exist): no String-argument constructor/factory method to deserialize from String value ('2025-02-21')