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

Support original name for structs #314

Open
ebooneBB opened this issue Oct 5, 2023 · 0 comments
Open

Support original name for structs #314

ebooneBB opened this issue Oct 5, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@ebooneBB
Copy link

ebooneBB commented Oct 5, 2023

A CLI option to allow for the original name in the avro schema (or fullname) to be maintained and capitalized in the resulting go struct would be beneficial.

Schema

{
  "name": "one_two_three_four__five",
  "type": "record",
  "fields": [
    {
      "name": "CreatedDate",
      "type": "long",
      "doc": "CreatedDate:DateTime"
    }
  ]
}

Current

Command

avrogen -pkg salesforce -o x.go -tags json:snake x.avsc

Output

package salesforce

// Code generated by avro/gen. DO NOT EDIT.

// OneTwoThreeFourFive is a generated struct.
type OneTwoThreeFourFive struct {
	CreatedDate int64 `avro:"CreatedDate" json:"created_date"`
}

Desired

Command (placeholder)

avrogen -pkg salesforce -o x.go -tags json:snake -originalname x.avsc

Output

package salesforce

// Code generated by avro/gen. DO NOT EDIT.

// One_two_three_four__five is a generated struct.
type One_two_three_four__five struct {
	CreatedDate int64 `avro:"CreatedDate" json:"created_date"`
}
@nrwiersma nrwiersma added the enhancement New feature or request label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants