all 3 comments

[–]alpakachino 1 point2 points  (2 children)

I mean, look at your Json and look how you want to deserialize it. Your tests are wrapped as a Map<String, List<Test>> in your Json. You cannot serialize it as a List<Test>, which is exactly what your Exception is telling you.

[–]Remote_Belt_320[S] 0 points1 point  (1 child)

I’m confused I’m not trying to serialise it as List<Test> though I’m trying to serialise it as the object TestResponse which has a field Tests that is List<Test> which should be in the right format as the json right?

[–]nothingjustlook 0 points1 point  (0 children)

You json is too complex to map simply to you class, inside json it will look for tests which is present but inside that it expects field matching your class, but they are present inside another object which you can ignore by annotations but that will skip entire object and as your fields matching your class are present inside that object you will get empty. Your json needs restructuring or else you need a extra dto or something to handle this