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
@JsonCreator and companion object #110
Comments
It's not currently possible with the In the interim, you might be able implement support directly for your own types by creating your own custom module. The outline of this approach looks like:
|
Thank you Christopher for your quick answer. Currently, as a quick and dirty workaround, I'm using the scala module for serialization and Jacks for deserialization. |
If you're using separate
If you're not in a position to implement a custom |
I'm applying the same configuration (PropertyNamingStrategy,Visibility,SerializationInclusion) to the both object mappers. Thus I expect that the first point won't be an issue. I'll try to implement my own ValueInstantiator if I encounter any bug in my Unit tests. |
Caches used are separate between serialization and deserialization; I can not think of any shared caching at databind level, or even at core streaming API level. |
There are test cases in latest versions of jackson-module-scala that use |
I have a question related to the @JsonCreator annotation. The Jacks library allows to use this annotation in combination with the companion object of the case class to be deserialized. It has the benefit to be less obstrusive than defining a secondary constructor in the case class. My problem is that it is sometimes hard to deal with multiple constructors having default values.
So is it possible with the scala module to use the @JsonCreator annotation in the companion object ?
The text was updated successfully, but these errors were encountered: