Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make empty tags configurable during serialization#640

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Croway wants to merge6 commits intoFasterXML:2.17
base:2.17
Choose a base branch
Loading
fromCroway:2.17

Conversation

@Croway
Copy link

No description provided.

returnnull;
}
if (FromXmlParser.Feature.EMPTY_ELEMENT_AS_EMPTY_ARRAY.enabledIn(_formatFeatures)) {
returnJsonToken.START_ARRAY.asString() +JsonToken.END_ARRAY.asString();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I am not sure how this makes sense -- all we get here is String "[]", which won't be further decoded?

@cowtowncoder
Copy link
Member

Ok, I can see what this PR does, but I am not quite sure how it makes any sense as a feature.

@Croway
Copy link
Author

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?)

@cowtowncoder
Copy link
Member

@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 onXmlFactory (throughXmlFactoryBuilder -- 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.

@Croway
Copy link
Author

Thanks for the hint@cowtowncoder I have updated the PR.

@CrowayCroway changed the titleAdd EMPTY_ELEMENT_AS_EMPTY_ARRAY FeatureMake empty tags configurable during serializationFeb 21, 2024
@cowtowncoder
Copy link
Member

@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 tocla at fasterxml dot com.
And once I get it I can proceed.

Looking forward to merging this new feature!

@pjfanning
Copy link
Member

@Croway Did you ever fill in the CLA? The 2.18.0 RC1 is in a few weeks.

@Croway
Copy link
Author

@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.

@cowtowncoder
Copy link
Member

Quick note: PR would need to be re-based against2.18 as well.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cowtowncodercowtowncodercowtowncoder left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@Croway@cowtowncoder@pjfanning

[8]ページ先頭

©2009-2025 Movatter.jp