Skip to content

Conversation

@JooHyukKim
Copy link
Member

resolves #5369

@JooHyukKim
Copy link
Member Author

Lemme know if there's anything I can improve on

@cowtowncoder
Copy link
Member

@JooHyukKim Sorry, been swamped with introspection bug fixes; this is still on my todo list to review soon. :)

@cowtowncoder
Copy link
Member

Ok, so added a note on issue: I think we have to add a feature (probably MapperFeature) to allow opt-in of this functionality since it seems to have backwards compatibility risks.

@JooHyukKim
Copy link
Member Author

Added SerializationFeature.APPLY_JSON_INCLUDE_FOR_COLLECTIONS(false), name TBD :-)

@github-actions
Copy link

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 78.59% 📉 -0.170%
Branches branches 72.22% 📉 -0.280%

Coverage data generated from JaCoCo test results

@github-actions
Copy link

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 78.59% 📉 -0.180%
Branches branches 72.22% 📉 -0.310%

Coverage data generated from JaCoCo test results

import static org.junit.jupiter.api.Assertions.assertEquals;

// [databind#5369] Support `@JsonInclude` for collection
public class JsonIncludeForCollection5369Test
Copy link
Member

Choose a reason for hiding this comment

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

Good start, but will also need to cover more of types:

  • Object[]
  • String[]

to exercise ObjectArraySerializer and StringArraySerializer respectively.

And maybe non-String List (like List<Integer> or such)?

@cowtowncoder
Copy link
Member

Looks good overall; needs bit more test coverage. But also looks like some deprecated methods/constructors are being called (as per IDE warnings), probably need to change to either:

  1. Change call to non-deprecated method
  2. Mark caller itself deprecated (like when overriding deprecated method).

Anyway I hope to do proper review soon: but I like how PR is getting ready!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support @JsonInclude for Collection

2 participants