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

Duru Can Celasun updated THRIFT-5046:
-------------------------------------
    Comment: was deleted

(was: Turns out this is not trivial to implement. The generator would have to 
understand and parse the Go struct tag syntax.)

> 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
>
> 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)

Reply via email to