I have two packages running, one is written in python and the other in Java. The python package encodes a json(dictionary) object and sends it to the java package which decodes it into a specific POJO.
Let the json in python be:
{ "name": "John", "Age": 24, "Income": None }
The problem is that Java does not support None, it supports null, hence it is unable to parse the received json throwing error that "found None expected true, false, null, NaN".
Base64 encoding of above json in python:
eyAibmFtZSI6ICJKb2huIiwgIkFnZSI6IDI0LCAiSW5jb21lIjogTm9uZX0=
Base64 encoding of above json in java:
eyAibmFtZSI6ICJKb2huIiwgIkFnZSI6IDI0LCAiSW5jb21lIjogbnVsbH0=
I need to parse the null value in Java as well and cannot simply drop it from the json. What can be the possible solutions to avoid this error?