-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static JsonCreator method does not work when using DefaultScalaModule #229
Comments
This is still a huge problem for us. Has anyone taken a look at this? |
@jarreds It may make sense to ask on |
…ic-creator-method Adds test that asserts that Static @JsonCreator method does work - refs #229
A bug fix for this (hopefully works) is going to be released in v2.6.5, and v2.7.2 (note: 2.7.0/2.7.1 are not going to be released since they won't work). Can you please upgrade and check if #236 fixes your issue? |
Hi, I'm experiencing this problem as well, and can confirm that 2.6.5 does not fix this issue. |
For me to reproduce I should be able to create a dropwizard project where the configuration contains a single Duration? Or do you think there is something more involved than that? |
Ideally of course wouldn't require dep to dropwizard. But I think it has some custom deserializers of its own, for |
Don't even need that; there's DW doesn't use custom deserializers for |
Ok, here's a test case: https://github.com/kelnos/dw9-jackson-scala-failure-repro -- instructions are in the README. For reference, here is the specific version of Also perhaps of note, if you create a custom jackson deserializer for |
Can also confirm that disabling |
Thank you, @kelnos, for providing a test case. I've discovered that this issue has nothing at all to do with the Scala Module, except that we use / register a ParanamerAnnotationIntrospector (as somewhat alluded to in #221). If you create a module that only registers Paranamer it has this issue. I will still see what I can do to follow up and/or fix since it is a scala module dependency. This is the minimal failing test I've found so far (and the serialization half is fine): object Test extends App {
val mapper = new ObjectMapper with ScalaObjectMapper
mapper.registerModule(new JacksonModule {
this += (_.appendAnnotationIntrospector(new ParanamerAnnotationIntrospector()))
})
val ser = mapper.writeValueAsString(Duration.minutes(1))
val x = mapper.readValue[Duration](ser)
} |
closing this - probably fixed with FasterXML/jackson-databind#1001 -- please reopen if it is still an issue |
This bug makes it impossible to use DefaultScalaModule together with Dropwizards.
DefaultScalaModule fails while processing https://github.com/dropwizard/dropwizard/blob/master/dropwizard-util/src/main/java/io/dropwizard/util/Duration.java
Relates to #221
I will supply PR with test that shows this issue
The text was updated successfully, but these errors were encountered: