Make empty tags configurable during serialization#640
Make empty tags configurable during serialization#640Croway wants to merge 6 commits intoFasterXML:2.17from
Conversation
| return null; | ||
| } | ||
| if (FromXmlParser.Feature.EMPTY_ELEMENT_AS_EMPTY_ARRAY.enabledIn(_formatFeatures)) { | ||
| return JsonToken.START_ARRAY.asString() + JsonToken.END_ARRAY.asString(); |
There was a problem hiding this comment.
I am not sure how this makes sense -- all we get here is String "[]", which won't be further decoded?
|
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. |
|
@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 |
|
Thanks for the hint @cowtowncoder I have updated the PR. |
src/main/java/com/fasterxml/jackson/dataformat/xml/deser/FromXmlParser.java
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/dataformat/xml/deser/FromXmlParser.java
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/dataformat/xml/deser/XmlTokenStream.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/dataformat/xml/deser/XmlTokenStream.java
Outdated
Show resolved
Hide resolved
|
@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 Looking forward to merging this new feature! |
|
@Croway Did you ever fill in the CLA? The 2.18.0 RC1 is in a few weeks. |
Hi @pjfanning I am truly sorry about this situation, but I am still waiting a response from my company legal team. |
|
Quick note: PR would need to be re-based against |
No description provided.