-
-
Notifications
You must be signed in to change notification settings - Fork 141
IonObjectMapper
does not throw JacksonException for some invalid Ion
#311
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
Comments
IonObjectMapper
does not throw JacksonException for some invalid Ion
@popematt Ok, looks like there is some issue with Jackson 3.0 and these changes -- looks like there is somehow no failure for unknown symbols? I don't know how to look into possible problem so pushed changes to Note that changes between 2.x and 3.0 wrt renamed methods should not change semantics. But I guess something is changed... Reopening the issue; leaving the patch in for now. |
I think now that #314 is merged, we can close this, right @cowtowncoder ? |
Yes. |
In some cases, the IonObjectMapper is not correctly catching and wrapping IonExceptions. For example, given this class:
When attempting to deserialize invalid Ion, sometimes we get a JsonMappingException, and other times an IonException.
Why does this matter? Some other libraries (eg. Ktor, in the
JacksonConverter
) expect particular exceptions (eg.JsonParseException
orJsonMappingException
) from anObjectMapper
, and behave in unexpected ways when theIonException
leaks through.I believe the fix for this is to catch and wrap
IonException
as aJsonParseException
in theIonParser.nextToken()
method, and I intend to work on a PR for it.The text was updated successfully, but these errors were encountered: