I wrote custom JsonDeserializer for deserializing array of maps:

```
"fieldNr2": [
    {
        "3.0": 3.1
    },
    {
        "2.0": 2.1
    },
    {
        "4.0": 4.1
    },
    {
        "5.0": 5.1
    },
    {
        "1.0": 1.1
    }
]

```

to TreeMap with javax validation:

```
TreeMap<@Positive BigDecimal, @NotNull @Positive BigDecimal>

```

Problem is that I don't know how to define array of maps (with specified class for key and value) in ObjectCodec.readValue() method. I have tried to use TypeReference with no success.

where is my code:

```
class TreeMapDeserializer extends JsonDeserializer<TreeMap<BigDecimal, BigDecimal>> {

@Override
public TreeMap<BigDecimal, BigDecimal> deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {

    ObjectCodec oc = jsonParser.getCodec();
    TreeMap<BigDecimal, BigDecimal>[] input = oc.readValue(jsonParser, TreeMap[].class);

    TreeMap<BigDecimal, BigDecimal> output = new TreeMap<>();
    for (TreeMap map : input) {
        Map.Entry<BigDecimal, BigDecimal> mapEntry = (Map.Entry<BigDecimal, BigDecimal>) map.entrySet().stream().findFirst().get();

        BigDecimal key = mapEntry.getKey();
        BigDecimal value = mapEntry.getValue();
        output.put(key, value);
    }

    return output;
}

```

Also, when I comment out javax constraint validation. App runs without a problem, but when i turn it back on Jackson is failing trying to parse String to BigDecimal (?) or failing to parse Double to BigDecimal (?).

```
Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: java.lang.String cannot be cast to java.math.BigDecimal; nested exception is com.fasterxml.jackson.databind.JsonMappingException: java.lang.String cannot be cast to java.math.BigDecimal (through reference chain:

```