Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 2
    This answer worked for me: Java 11, Jackson 2.10.5. Commented Oct 4, 2022 at 19:48
  • 1
    Answer worked for me, and is clear and concise. Love it. For me, I had a generic method that passed in a Class<T> myGenericClass and was able to do: List<T> list = mapper.readerForListOf(myGenericClass).readValue(json); Which worked nicely for my solution. Thanks again! Commented Apr 13, 2023 at 10:13
  • Good luck testing this! Cannot invoke "com.fasterxml.jackson.databind.ObjectReader.readValue(byte[])" because the return value of "com.fasterxml.jackson.databind.ObjectMapper.readerForListOf(java.lang.Class)" is null Commented May 3, 2023 at 21:06
  • Works great ! The unsung hero Commented Nov 14, 2023 at 15:13