question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.1.x: JsonNodeDeserializer returns Java null instead of a NullNode on deserialization: on purpose?

See original GitHub issue

Link:

http://stackoverflow.com/questions/15293697/how-to-deserialize-json-null-to-a-nullnode-instead-of-java-null

I needed it because for my JSON Patch implementation, it is perfectly legal to replace/add/test for a JSON null value.

But JsonNodeDeserializer returns null by default instead of a NullNode. Not sure whether this was meant, or whether changing it would break existing code etc.

Patches for master and 2.1 provided it was not meant to be this way:

UPDATE: master not affected, therefore 2.2.x not affected. Bisected.

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
codecracker2014commented, Dec 21, 2016

Hi @cowtowncoder after upgrading jackson from 2.2.2 to 2.7.7 for my project i’m facing issue due to change in deserialization of null into “null” string. Earlier it was deserializing it to null String object. Is there some configuration to achieve it.

0reactions
cowtowncodercommented, Mar 11, 2013

My tests read instance of JsonNode, not a property with that type. I take that was the difference. Merged fix back in 2.1 as well; hoping to deprecate 2.1 as soon as 2.2.0 is out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to deserialize JSON null to a NullNode instead of Java ...
public final class JsonNullAwareDeserializer extends JsonNodeDeserializer { @Override public JsonNode getNullValue() { return NullNode.
Read more >
Ignore Null Fields with Jackson - Baeldung
This quick tutorial is going to cover how to set up Jackson to ignore null fields when serializing a java class.
Read more >
How to deserialize a JSON array to a singly linked list by using ...
I want to deserialize a JSON array to a singly linked list in Java. The definition of singly linked list is as the...
Read more >
Uses of Interface com.fasterxml.jackson.databind.deser ...
Bogus deserializer that will simply skip all content there is to map and returns Java null reference. static class, NumberDeserializers.BigDecimalDeserializer.
Read more >
Serialization and Deserialization in Java with Example
Serializable interface. The ObjectOutputStream class contains writeObject() method for serializing an Object. public final void writeObject( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found