vavr-io / vavr-jackson

Jackson datatype module for Vavr
Apache License 2.0
97 stars 35 forks source link

registering the jaxb annotation module breaks (at least) option jackson integration #110

Closed emmanueltouzery closed 7 years ago

emmanueltouzery commented 7 years ago

Trying to upgrade our app from javaslang 2.0.6 to vavr 0.9.0, I've hit an issue which I've reproduced there with the vavr-jackson test:

https://github.com/emmanueltouzery/javaslang-jackson/commit/a32fb7f869a2bbb4d6f8fb4fdaf09a1b81f8c2ab

if you register a jaxb annotation module also for your json operation (it's a bit unusual, but we do that...) breaks things like Option serialization. This used to work with javaslang-jackson 2.0.5 (I've tested the same thing there, and it works just fine there).

The exception is:

Tests in error: 
  testJsonTypeInfo2(io.vavr.jackson.datatype.OptionTest): Must call method with a container type (got [reference type, class io.vavr.control.Option<io.vavr.jackson.datatype.OptionTest$TestSerialize<[simple type, class io.vavr.jackson.datatype.OptionTest$TestSerialize]>])
  testWrappedParameterizedSome(io.vavr.jackson.datatype.OptionTest): Must call method with a container type (got [reference type, class io.vavr.control.Option<java.lang.Integer<[simple type, class java.lang.Integer]>])
  testWrappedWildcardSome(io.vavr.jackson.datatype.OptionTest): Must call method with a container type (got [reference type, class io.vavr.control.Option<java.lang.Object<[simple type, class java.lang.Object]>])
emmanueltouzery commented 7 years ago

hmm actually that also happens for XML operations, therefore it's more serious. It seems vavr-jackson 0.9.0 can't be used with JAXB annotations at all.

emmanueltouzery commented 7 years ago

ok I found the upstream bug and it's fixed with jackson 2.7.9 so not the fault of vavr-jackson and I'm going to close this bug.

https://github.com/fasterxml/jackson-module-jaxb-annotations/issues/63

danieldietrich commented 7 years ago

Thank you

ruslansennov commented 7 years ago

@emmanueltouzery In case of your app, which Jackson version fails?

emmanueltouzery commented 7 years ago

The PR shows it fails with 2.7.2 as in the pom of vavr-jackson. But it passes with 2.7.9 (see the bug i linked). In a way it could make sense to increase vavr-javaslang dependency to jackson 2.7.9 but since 2.7.x are api compatible it's not really an issue.

ruslansennov commented 7 years ago

Now vavr-jackson tests with two versions:

script:
- mvn clean test -B  // 2.7.2 by default version in pom.xml
- mvn clean test -B -Dfasterxml.version=2.8.4

Maybe we should bump default version to 2.7.9?