-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
invesigate issue with defaulted params in case classes when value in json is null #453
Comments
@mley I reread the issue you raised and the new behaviour seems correct to me. There is no easy way to make the BeanIntrospector parameterisable to allow it to optionally behave the old way. My recommendation would be that you create a DTO class that has no defaults. I use https://scalalandio.github.io/chimney/ in my day job a lot to do low boiler plate transforms between DTOs and internal model classes. |
You can also use jackson mixins.
|
Thanks for taking time to look into it, @pjfanning . In my opinion the behaviour is not correct, when the JSON value is set explicitly to null and the field is an
Just for the record if other people stumble up on this: I could restore the old behaviour by creating my own custom Scala Jackson module with a custom ScalaAnnotationIntrospectorModule that does not register the ValueInstantiator. (removed this line: Line 176 in 913cdb9
But we are not going that way. We will go with the new behaviour and try to avoid of default values. |
You can also register a variant of DefaultScalaModule that doesn't include ScalaAnnotationIntrospectorModule |
#87 (comment)
The text was updated successfully, but these errors were encountered: