[ https://issues.apache.org/jira/browse/THRIFT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14330359#comment-14330359 ]
Jens Geyer commented on THRIFT-3006: ------------------------------------ GitHub user pjjw opened a pull request: https://github.com/apache/thrift/pull/380 add go json annotation 'omitempty' on optionals if a field is optional, we shouldn't need to assert its nullness when serializing to json. this additionally matches protobuf behavior. You can merge this pull request into a Git repository by running: $ git pull https://github.com/pjjw/thrift THRIFT-3006 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/380.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #380 > Attach 'omitempty' json tag for optional fields in Go > ----------------------------------------------------- > > Key: THRIFT-3006 > URL: https://issues.apache.org/jira/browse/THRIFT-3006 > Project: Thrift > Issue Type: Improvement > Components: Go - Compiler > Reporter: peter woodman > Assignee: Jens Geyer > > This pull request improves on THRIFT-2549 in that it additionally tags > optional fields with the omitempty tag so that dumping a struct to json > doesn't result in a bunch of null fields. I think this is the right thing to > do with optional fields, and additionally it matches the protoc behavior in > go. -- This message was sent by Atlassian JIRA (v6.3.4#6332)