-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Exception when parsing List
s of mixed content (since 2.13.0)
#509
Comments
I ran into the same issue earlier today. This problem seems to have been introduced with 6c37f48
For example, following entry is triggering this "error state". I think throwing an error is the wrong course of action here, so I suggest removing this error check again.
Is there a chance this can be fixed? Because right now, it's blocking us from updating to a newer version. |
Sounds like something to address, yes. I know there is a test but it'd be great to get a simpler one if possible: also, plan Java as I assume this is not Kotlin-specific. |
@ptziegler Any chance you could provide full reproduction; or at least POJOs being used? Your case is somewhat different as it only contains (ignorable) white-space, not non-empty content, so it might be supportable. The original case isn't possible to map to POJOs (can be mapped to |
This adds two additional test cases. Those test attempt to deserialize the two classes Data and MetaData. The MetaData class simply contains a list of Data objects. The Data class contains a "key", which is derived from the attribute of the XML node, and a "content" list, which is the arbitrary data stored inside that node.
This adds two additional test cases. Those tests attempt to deserialize the two classes Data and MetaData. The MetaData class simply contains a list of Data objects. The Data class contains a "key", which is derived from the attribute of the XML node, and a "content" list, which is the arbitrary data stored inside that node.
This adds two additional test cases. Those tests attempt to deserialize the two classes Data and MetaData. The MetaData class simply contains a list of Data objects. The Data class contains a "key", which is derived from the attribute of the XML node, and a "content" list, which is the arbitrary data stored inside that node.
@cowtowncoder I've created #604 |
This adds two additional test cases. Those tests attempt to deserialize the two classes Data and MetaData. The MetaData class simply contains a list of Data objects. The Data class contains a "key", which is derived from the attribute of the XML node, and a "content" list, which is the arbitrary data stored inside that node.
Thank you @ptziegler ! |
Hello! I'm wondering if there is any recent movement on this issue? Spring Framework 6.1 was released last November, raising the minimum requirement for Jackson to 2.14 (https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#upgrading-to-version-61). Our project relies on being able to parse mixed content, and this issue is blocking us from upgrading to the latest version of Spring, as we need to pin 2.12 to avoid this bug. I'd be happy to look into contributing back to the project in order to expedite this fix if possible. |
Unfortunately I haven't had time to look into this @wickstopher. There is a failing test under Fix would need to go in 2.16 branch or later (2.18 is the next minor version to add but unless fix requires API change, can be merged to latest open branch which I think is 2.16). |
Also verified that the problem exists in |
@cowtowncoder Thanks for the reply. I also have somewhat limited time, but in looking into it yesterday evening it looks like a (potentially incorrect?) assumption was made when the following Exception case was added in // 29-Mar-2021, tatu: This seems like an error condition...
// How should we indicate it? As of 2.13, report as unexpected state
throw _constructError(
"Unexpected non-whitespace text ('"+_currText+"' in Array context: should not occur (or should be handled)"
); 2.13 is the version in which this functionality broke, and removing this Would you be willing to consider a stopgap PR in which this was addressed in such a manner? If so I'd be happy to put one together. |
@wickstopher Yes, that sounds reasonable given the lack of time for finding proper fix to handling, so PR for 2.16 branch would be welcome (with an additional comment pointing to this issue as follow-up) |
@cowtowncoder PR is up here: #651 Thanks very much for your consideration! |
List
s of mixed content (since 2.13.0)
Temporary fix included in:
whenever those are released (may be a while as 2.17.2 was just released; 2.16 has only this fix in branch) |
In Jackson 2.12 the following junit example test (written in Kotlin) works as I'd expect it to
But when I upgrade to 2.13, I get the following error
This feels like a bug, but I'm not sure if there's some workaround or setting I'm missing somewhere.
The text was updated successfully, but these errors were encountered: