Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1624E200C22 for ; Tue, 21 Feb 2017 08:41:48 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1497B160B68; Tue, 21 Feb 2017 07:41:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6058C160B3E for ; Tue, 21 Feb 2017 08:41:47 +0100 (CET) Received: (qmail 7101 invoked by uid 500); 21 Feb 2017 07:41:46 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 7090 invoked by uid 99); 21 Feb 2017 07:41:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Feb 2017 07:41:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 30B32C7D4F for ; Tue, 21 Feb 2017 07:41:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.799 X-Spam-Level: * X-Spam-Status: No, score=1.799 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id N_AgRcRtgP47 for ; Tue, 21 Feb 2017 07:41:45 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7677560D7D for ; Tue, 21 Feb 2017 07:41:45 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A35C8E0570 for ; Tue, 21 Feb 2017 07:41:44 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1137C24123 for ; Tue, 21 Feb 2017 07:41:44 +0000 (UTC) Date: Tue, 21 Feb 2017 07:41:44 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@thrift.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (THRIFT-4011) Sets of Thrift structs generate Go code that can't be serialized to JSON MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 21 Feb 2017 07:41:48 -0000 [ https://issues.apache.org/jira/browse/THRIFT-4011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15875530#comment-15875530 ] ASF GitHub Bot commented on THRIFT-4011: ---------------------------------------- Github user Jens-G commented on the issue: https://github.com/apache/thrift/pull/1156 Ok, thanks. > Sets of Thrift structs generate Go code that can't be serialized to JSON > ------------------------------------------------------------------------ > > Key: THRIFT-4011 > URL: https://issues.apache.org/jira/browse/THRIFT-4011 > Project: Thrift > Issue Type: Bug > Components: Go - Compiler > Reporter: Can Celasun > > Consider the following structs: > {code} > struct Foo { > 1: optional string foo > } > struct Bar { > 1: optional set foos > } > {code} > This compiles into the following Go code: > {code} > type Bar struct { > Foos map[*Foo]struct{} `thrift:"foos,1" db:"foos" json:"foos,omitempty"` > } > {code} > Even though the generated code has tags for JSON support, Bar can't be serialized to JSON: > {code} > json: unsupported type: map[*Foo]struct {} > {code} > One solution would be to use slices, not maps, for Thrift sets. Thoughts? -- This message was sent by Atlassian JIRA (v6.3.15#6346)