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

Serialize empty tags to actual json array/object#642

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

Draft
Croway wants to merge8 commits intoFasterXML:2.17
base:2.17
Choose a base branch
Loading
fromCroway:json-array-serialize

Conversation

@Croway
Copy link

Hello@cowtowncoder , I think it would be nice to serialize empty tag into actual array/objects (in some cases), not text value, in particular, as you can see from the added test case<name><first/><last>[]</last></name> will be serialized as{"first":[],"last":"[]"} when using JsonNode, the empty tag first is serialized as an empty json array, not a text value.

But I feel like that mysolution is a bit hacky, do you have any hint?

Once#640 is merged I'll rebase this one.

@cowtowncoder
Copy link
Member

Yeah I am not sure I'm inclined to add support for this. Jackson, in general, tries to steer clear of 2 general areas:

  1. Validation of logical content (aside from well-formedness and needing to map between data, Java Objects) -- Bean Validation API to be used for validation, constraints-checking
  2. Structural transformations

Obviously there's some amount of functionality that overlaps here, but in general complexity of structural transformations is such, for streaming/incremental reading/writing that it seems best left out.
Things that are needed are already too complex.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Croway@cowtowncoder

[8]ページ先頭

©2009-2025 Movatter.jp