Skip to content

Conversation

@tdeebswihart
Copy link
Contributor

What changed?

  1. Map values may not be singular items but full values
  2. Empty maps should be marshalled as {}, not null

This fixes temporalio/api#349

Why?

Empty maps should always have been marshalled as empty objects, this was a bug in our code. While here I realized a deeper bug, where maps would only support simple values (strings, numbers, etc) but not embedded maps, lists, etc.

How did you test it?

New unit test

Potential risks

None

1. Map values may not be singular items but full values
2. Empty maps should be marshalled as `{}`, not `null`
@tdeebswihart tdeebswihart requested a review from cretz January 23, 2024 19:34
@tdeebswihart tdeebswihart requested review from a team as code owners January 23, 2024 19:34
Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

Thanks!

@tdeebswihart tdeebswihart merged commit 5b253c8 into master Jan 23, 2024
@tdeebswihart tdeebswihart deleted the tds/fix-empty-object-marshal branch January 23, 2024 19:43
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.

[Bug] api-go failing to properly handle nested empty objects for shorthand payloads

3 participants