Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not serialize empty collections and maps. #1245

Merged
merged 3 commits into from
Feb 11, 2021
Merged

Do not serialize empty collections and maps. #1245

merged 3 commits into from
Feb 11, 2021

Conversation

maciejwalkowiak
Copy link
Contributor

📜 Description

Do not serialize empty collections and maps.

💡 Motivation and Context

Fixes #1242.

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

@Test
fun `empty lists are serialized to null`() {
val transaction = SentryTransaction("tx")
val stringWriter = StringWriter()
Copy link
Contributor

Choose a reason for hiding this comment

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

can we reuse the method serializeToString?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change to serializeToString has been already done in #1235. Lets merge #1235 first and then we can refactor the rest of the test methods.

Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense

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.

Gson should not serialize empty list/map
2 participants