Closed Vance-Turner closed 3 years ago
Tried a wider variety of types. Interesting, everything works except List:
ObjectMapper mapper = new ObjectMapper().registerModule(new VavrModule());
String json = "[[-1,0.25],[1,0.75]]";
mapper.readValue(json, new TypeReference<Tuple2<Tuple2<Integer,Double>,Tuple2<Integer,Double>>>() {});
mapper.readValue(json, new TypeReference<Array<Tuple2<Integer,Double>>>() {});
mapper.readValue(json, new TypeReference<Queue<Tuple2<Integer,Double>>>() {});
mapper.readValue(json, new TypeReference<List<Tuple2<Integer,Double>>>() {});
hi @Vance-Turner could you test your reproducer with vavr 0.10.3?
Ah, thanks @ruslansennov. I see there is a 1.0.0-alpha-3 version for Jackson available as well and matching the versions 0.10.3 or 1.0.0-alpha3 works. I thought I had checked that.
Have I stumbled upon on a bug or am I doing the generics wrong?
I would like to parse the JSON above into List<Tuple2<Integer,Double>>. There could be more [int,double] entries; but I've included only two pairs in the example.
The first parsing attempt works; but the second fails:
I am using: