-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add support for nulls in maps #7
base: master
Are you sure you want to change the base?
Conversation
There are two problems that need to be addressed. One is that we're putting Second, in |
Can't maps have a single null key as well or is that a java specific implementation detail? |
I don't believe the JSON standard allows for a null key. Also, is this in response to the conversation in #6? |
Yeah sorry too many prs open. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zach told me to rescind this because of test failures.
Back from KotlinConf. Let me see I'm following. In
And |
This is what I meant. |
Ok cool, seems pretty similar to what I was doing. It still has the problems I listed above though. "Key1" parses to |
TestObject has an |
I looked at that method, and it only does that if the String value isn't null. I would have expected it to be null and not have that bit added. I'll look into it more. |
Lol. Yup, there is something else going on there. For the test that's failing because of a NumberFormatException, it's trying to convert |
Putting this up to start a convo about a... bug (?) I'm noticing, not really sure. This fails to pass the delayed object check because when parsing as a JSONObject:
"myStringMapWithSingleNullValue": { "key1": null },
Once the parser reaches the
{
, the next call toJsonReader
's peek method returns JsonToken.NULL. So we end up with a completely empty map. @ndtaylor is that expected? Is "key1" not a token?