You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new VavrModule());
// yields [1]
System.out.println(objectMapper.writeValueAsString(List.of(1)));
final Cat cat = new Cat();
cat.name = "Bianca";
final Either<Cat, Dog> either = Either.left(cat);
// yields java.lang.IncompatibleClassChangeError: Found class io.vavr.control.Either, but interface was expected
System.out.println(objectMapper.writeValueAsString(either));
Some observations:
evaluating io.vavr.jackson.datatype.serialize.EitherSerializer#serialize's own value parameter is just fine through debug watch.
Unless I am missing something, I think it may be a generics issue/type erasure in EitherSerializer (Either.One<Cat> is technically not a direct subtype of Either<?, ?>).
The text was updated successfully, but these errors were encountered:
Hi @mcac0006 , thanks for reporting this. It sounds like a bug. On my side, I tried to reproduce it but without success. Could you provide more detail, such as the version of Vavr-Jackson, the version of Jackson, the source code of Cat and Dog?
Here is the my attempt but both tests passed, using the last commit 0538bdb on master branch:
Some observations:
io.vavr.jackson.datatype.serialize.EitherSerializer#serialize
's own value parameter is just fine through debug watch.Unless I am missing something, I think it may be a generics issue/type erasure in
EitherSerializer
(Either.One<Cat>
is technically not a direct subtype ofEither<?, ?>
).The text was updated successfully, but these errors were encountered: