-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
@JsonAnySetter with @JsonUnwrapped: deserialization fails with arrays #349
Comments
Hmmh. I can not reproduce this with simple tests for |
Here's the code for ItemDTO -- the other child objects are again, simple value objects. I probably should have mentioned that I use a paired combination of Jackson and Jax-B annotations (in that order).
|
Upon trying my own tests by hand, I think the problem is that ItemDTO also has @JsonUnwrapped. When I take that out, I seem to get past this problem. |
Ah. That sounds plausible... combination of the two could be somewhat tricky. I can try to write a unit test; ideally that would be supported. But implementation of |
Right. I kind of agree that having them both is kind of asking for trouble. Is it possible to have two or more @JsonUnwrapped in the same class? If yes, then this could/should be supported. If not, then this should probably not be allowed either. In the end, having multiple unwrapped property collections supported would be cool, but its asking for collisions eventually. Up to you... |
Yes, two isntances of |
ok will do, thanks. |
@cowtowncoder It seems JsonAnySetter and JsonUnwrapped can work together in 2.9.0-SNAPSHOT but not in 2.8.6. I have added one test case here: |
This seems broken in 2.9.9, but in a different way... the |
I think that the way things are implemented duplicates would always have occurred. Later issue #1811 cover the problem: I hope this can be resolved in 3.0. |
My application makes heavy use of the @JsonAnySetter/Getter annotations which is currently throwing an exception when deserializing an JSON array of strings as a property value:
Here is the Java code:
and here is some sample JSON that will fail:
The text was updated successfully, but these errors were encountered: