emfjson / emfjson-jackson

JSON Binding for Eclipse Modeling Framework
https://emfjson.github.io
Other
80 stars 23 forks source link

attribute with null as value is not checked #81

Closed juergen-albert closed 8 years ago

juergen-albert commented 8 years ago

If a plain JSON is read like the following example:

"matches": [
{
"continent": {
"matchHighlights": [],
"value": "Europa"
},
"city": {
"matchHighlights": [],
"value": "Stuttgart"
},
"logo44x44rounded": "someUrl",
"rating": null,
"description": {
"matchHighlights": [],
"value": "some description"
}
]
}

The null that appears in rating is not checked and the deserialization stumbles and breaks.

The solution looks easy:

It looks like the following snippet would do the job if added to line 195 in the EObjectDeserializer.readFeature method if (jp.getCurrentToken() == JsonToken.VALUE_NULL) { return; }

ghillairet commented 8 years ago

Thanks for the PR, it's been added to the 0.15 release.

juergen-albert commented 8 years ago

Thx, Is the bug fix available on your p2 updatesite?

ghillairet commented 8 years ago

It should be there now, release 0.15.0.

juergen-albert commented 8 years ago

It appears, that http://ghillairet.github.io/p2/ is not available. Are there some structural changes I'm not aware of?

ghillairet commented 8 years ago

Fixed now.