-
-
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
XmlMapper
serializes @JsonAppend
property twice
#578
Comments
Sounds like a flaw. Thank you for reporting @stepince |
Any workaround for this issue? I am actually using a mixin class for the serialization. Maybe in VirtualBeanPropertyWriter Impl check if the property has been written. Not sure if this is possible? |
@stepince Without knowing why it's failing it is hard to suggest any workaround. But no, writer should not really have to check for anything, backend should not write duplicates. I hope I'll have time to look into this in near future -- existence of unit test should be great help. |
Hi @cowtowncoder, Not sure if this helps, but I was able to track down where the property is getting set twice. It is in this file (AnnotationIntrospectorPair.java) lines 594 and 595. The first virtual prop is getting set when |
@mukham12 that is indeed helpful! Question then being why do we have 2 |
Ah. That is because Hmmh. In a way fix is easy, although I need to think it through -- basically have a switch to prevent some of the calls to super class. The reason for a switch (as opposed to just blocking) is that this implementation may be used directly as well, as a replacement of But at least I now know how to implement this. |
Happy to help. I may be able to help with the implementation if you can just nudge me in the right direction and lay out the overall plan. Thanks. |
XmlMapper
serializes @JsonAppend
property twice
Fixed by simply overriding and blocking |
Thx Tatu. I see that the fix will be released in 2.15 . I don't see a release date for 2.15. |
@stepince Project does not have pre-planned release dates; releases occur when versions are considered ready. Having said that, general expectations are updated sometimes on project release page: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.15 |
Discussed in FasterXML/jackson-databind#3806
Originally posted by stepince March 5, 2023
XmlMapper is serializing jsonAppend virtual property twice. ObjectMapper for json works correctly.
jackson version: 2.14.1
output
The text was updated successfully, but these errors were encountered: