-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Empty String deserialized as null
instead of empty string
#130
Comments
Hmmh. I do not have a good answer here, but "Null replacement/error/skipping" introduced in 2.9: https://medium.com/@cowtowncoder/jackson-2-9-features-b2a19029e9ff would at least allow coercing |
Please also check ... #116 |
Finally got around to have another look: fix seems easy, but timing is bit challenging as we are past last RC for 2.12.0. I think, however, that I can add a |
null
instead of empty string
Fixed this by adding a new feature, |
Hello,
I have the following issue/question for which I was hoping to find a easy solution.
I have inherited a large codebase where I am trying to migrate from jackson 2.6.4 to 2.9.8. The project contains multiple
YAML
files which are deserialized usingcom.fasterxml.jackson.dataformat.yaml.YAMLMapper
. Most of these files contain empty fields e.g.With version 2.6.4 these fields were being decoded to empty strings, while after migrating to 2.9.8 the field evaluated to
null
. I have managed to trace the diverging behavior incom.fasterxml.jackson.dataformat.yaml.YAMLParser#_decodeScalar
.The 2.6 version was evaluating the field to
JsonToken.VALUE_STRING
while the 2.9 version is using SnakeYaml implicit resolvers and evaluates toJsonToken.VALUE_NULL
.What is the desirable way to keep the behavior from 2.6, deserialize empty fields to empty string instead of null, after migrating to 2.9?
The text was updated successfully, but these errors were encountered: