-
-
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
None is written as null with Include.NON_NULL set since 2.7.4 (also another issue with 2.7.3 and earlier) #325
Comments
@dimatkach What you want to do here is to use value to see full definitions of intended operation of values. Now: I think handling is correct: Exact implementation did indeed change a bit up until version 2.7 (and, regrettably, it seems, for one of patch versions, at least for Scala module?). Behavior should be stable from this point on. I hope this helps. |
This fixes issue hashicorp#3. Updated SubmitRestProtocolMessage because of the change in jackson's handling of null/absent values described here: FasterXML/jackson-module-scala#325
Jackson is incompatible with upstream versions, therefore bump the Jackson version to a more recent one. Behaviour has changed since 2.7.x that None is not considered null anymore: FasterXML/jackson-module-scala#325 This will only include value that indicates that only properties with null value, or what is considered empty, are not to be included. https://fasterxml.github.io/jackson-annotations/javadoc/2.7/com/fasterxml/jackson/annotation/JsonInclude.Include.html Change the flags to NON_ABSENT
Jackson is incompatible with upstream versions, therefore bump the Jackson version to a more recent one. Behaviour has changed since 2.7.x that None is not considered null anymore: FasterXML/jackson-module-scala#325 This will only include value that indicates that only properties with null value, or what is considered empty, are not to be included. https://fasterxml.github.io/jackson-annotations/javadoc/2.7/com/fasterxml/jackson/annotation/JsonInclude.Include.html Change the flags to NON_ABSENT
case class Foo(bar: Options[String] = None)
gets written as
{ "bar": null }
.This used to work for me before (at least, in 2.6.6). Not sure at which point it got broken, I ran into this issue trying to upgrade to
2.8.8
.Update: Looks like the last version it works right is
2.7.3
. I haven't checked everything after that, but2.7.{4,5,9}
and2.8.0
are all broken.Unfortunately, I cannot use
2.7.3
or2.7.2
, because they have another issue (seems to be gone in 2.8.8, so I am not reporting it separately): if I have atrait
extending aProduct
, and a case class with a field, that'sOption
of that trait, then serializing that case class always writes that field as empty:So, it looks like I am stuck with 2.6.6. for now ... :(
The text was updated successfully, but these errors were encountered: