A bit lost... Jackson deserialization A bit lost... Jackson deserialization json json

A bit lost... Jackson deserialization


You might be able to use http://fasterxml.github.io/jackson-annotations/javadoc/2.5/com/fasterxml/jackson/annotation/JsonFormat.Shape.html to ask Jackson to map directly to an array. In this mode, jackson requires you to annotate the order of the properties, and maps from a json array to an object.


If the individual items aren't using name value pairs, then you'll need to write some kind of custom deserializer that understands the relationship between the array offsets in this:

[0, "all", [0]]

And maps them to the properties in the AnkiNoteTypeReq. I know there is a mechanism in Jackson where you can specify that a given type should be deserialized using a custom class, but I don't remember the exact syntax. As a first pass I would use Jackson to deserialize the JSON string to a JsonNode and do manual deserialization by creating a function like

static AnkiNoteTypeReq fromJsonNode(JsonNode node) {   ...}