You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Duru Can Celasun (Jira)" <ji...@apache.org> on 2019/12/13 13:11:00 UTC

[jira] [Resolved] (THRIFT-5046) Custom tags remove db and json tags

     [ https://issues.apache.org/jira/browse/THRIFT-5046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Duru Can Celasun resolved THRIFT-5046.
--------------------------------------
    Fix Version/s: 0.14.0
       Resolution: Fixed

> Custom tags remove db and json tags
> -----------------------------------
>
>                 Key: THRIFT-5046
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5046
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Go - Compiler
>    Affects Versions: 0.13.0
>            Reporter: Duru Can Celasun
>            Assignee: Duru Can Celasun
>            Priority: Minor
>             Fix For: 0.14.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Given the IDL:
> {code}
> struct Example {
>   1: bool withTag (go.tag = "foo:\"bar\"")
>   2: bool withoutTag
> }
> {code}
> The generated code looks like:
> {code}
> type Example struct {
>   WithTag bool `thrift:"withTag,1", foo:"bar"`
>   WithoutTag bool `thrift:"withoutTag,2" db:"withoutTag" json:"withoutTag"`
> }
> {code}
> The bug is on [this line|https://github.com/apache/thrift/blob/6e023df1ded255dda00eb4c041c201e66c8d1fbc/compiler/cpp/src/thrift/generate/t_go_generator.cc#L1396] of the Go generator where any custom tag overwrites the existing db and json tags.
> Custom tags that aren't overrides should be appended instead of replacing the whole thing.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)