Closed k631583871 closed 2 months ago
Example seems to be missing definition of Bean
class? That is needed to understand issue.
(note: moved from jackson-databind
to this repository since it is related to JavaTimeModule
)
public static class Bean {
List<Map<String, String>> list;
public List<Map<String, String>> getList() {
return list;
}
public void setList(List<Map<String, String>> list) {
this.list = list;
}
}
Not a bug, the error must be caused by \"op\":[{\"id\":1}]
is inserted in Map<String,String>
same level as "A1"
, "A2"
Also looks like custom deserializer is blindly calling parser.getText()
without verifying actual JsonToken
. Which is asking for trouble -- esp. if parser is pointing to Array or Object, because if so, the whole value (multiple tokens) must be consumed. And the exception suggests that in fact this is the case I here.
Search before asking
Describe the bug
Version Information
2.17.1
Reproduction
<-- Any of the following
Expected behavior
Cannot deserialize value of type
java.lang.String
from Array value (tokenJsonToken.START_ARRAY
)Additional context
No response