-
-
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
ToXmlGenerator
ignores Base64Variant
while serializing byte[]
#377
Comments
Sounds like a reasonable improvement request. I am not sure how easy it would be to do: stax2 API that Woodstox implements does actually have |
@cowtowncoder thank you for the quick analyzing the problem! I think, it looks pretty straightforward, to map base64 variants from jackson to stax2. The only thing i'm strumbling over are the some convinience methods. So i could break some important use cases while trying to implement a patch without deeper understanding of the library. Also changing the default Variant of stax2 would be a major breaking change, i think (although for my/default use case helpful) |
Yes, there can be challenges. Leaving default choice as-is could be doable (by forcing different default for |
Starting to work on this, noting that stax2 and jackson default variants align nicely wrt names, but that defaults are different (as already mentioned, so that):
so the main challenge is just to figure out a way to retain default setting for backwards compatibility, even if it is not quite optimal for XML use case -- users can change defaults for |
Oh. Actually looks like Stax2 default of |
ToXmlGenerator
ignores Base64Variant
while serializing byte[]
Ok. So, this is now implemented, without changing defaults but making it possible to change default to change serialization. There are couple of potential concerns that may need future work:
Still, I think this is useful improvement over earlier versions: functionality will be included in 2.12(.0). |
# Conflicts: # release-notes/CREDITS-2.x # release-notes/VERSION-2.x
Hello, i'm using Jackson mapper and dataformat-xml 2.10.0 brought by Spring Boot 2.2.1.
Currently i recognize following problem: byte[] is properly serialized to base64 but in a wrong Base64Variant. I'm expecting the serialization in a default base64variant MIME-NO-LINEFEEDS but this is not the case, regardless, what variant i configure on an ObjectMapper. This because the ToXmlGenerator accepts the parameter b64variant but doesn't propagate it to underlying _xmlWriter (in my case woodstox stax2) which uses by default MIME Base64 Variant.
Could someone please improve this.
Many thanks in advance and kind regards,
Gena
The text was updated successfully, but these errors were encountered: