Open Croway opened 4 months ago
Ok, I can see what this PR does, but I am not quite sure how it makes any sense as a feature.
Hello, I have an usecase (mostly due to compatibility) that requires to have empty xml tags serialized as json empty array. If you think this usecase does not make sense, could you suggest how to implement it? (custom Serializer?)
@Croway I think this is unfortunately bit too specific to add as a general on/off feature.
I suspect it would not be easy to implement as custom deserializer (but might be possible)
I would be open to configuration setting that allows configuring value to return as any String (so in your case, you could set it as "[]"
). This would need to be configuration on XmlFactory
(through XmlFactoryBuilder
-- it has _nameForTextElement
to kind of show how to do this I think).
Such general purpose functionality could be useful for other things too I suspect.
Thanks for the hint @cowtowncoder I have updated the PR.
@Croway Ok I think this would work. Before merging, there is one small process part: we'd need CLA from: https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf
this only needs to be done once, before the first contribution and is good all future contributions.
The usual way is to print, fill & sign, scan/photo, email to cla
at fasterxml dot com.
And once I get it I can proceed.
Looking forward to merging this new feature!
Ok, I can see what this PR does, but I am not quite sure how it makes any sense as a feature.