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

Marshal nil collections (maps, sets, lists) as empty #73

Open
nmiyake opened this issue Jul 16, 2019 · 0 comments
Open

Marshal nil collections (maps, sets, lists) as empty #73

nmiyake opened this issue Jul 16, 2019 · 0 comments

Comments

@nmiyake
Copy link
Contributor

nmiyake commented Jul 16, 2019

What happened?

  • Define a Conjure object with a map, list and set field
  • Marshal the empty Conjure object
  • The JSON representation contains the key for each of the fields and the values are null

What did you want to happen?

  • The JSON representation should contain a key for each of the field, but the value should be an empty map/list rather than null

Although the spec notes that Conjure clients/servers should coerce null to an empty value, in practice older Java implementations did not do this, and there are implementations like Typescript that do not have a serde layer and cannot properly handle this. There have also been conversations about updating the spec to require this behavior.

Updating the Go implementation to produce empty values rather than null will improve compatibility with other implementations.

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 a pull request may close this issue.

1 participant