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

[REQ] [GO] [SERVER] Added enumClassPrefix option to go-gin-server generation #8680

Closed
pmcgleenon opened this issue Feb 11, 2021 · 1 comment

Comments

@pmcgleenon
Copy link
Contributor

pmcgleenon commented Feb 11, 2021

Is your feature request related to a problem? Please describe.

I'm running into problems with the go-gin-server target for generated enums.

I see go-server already has this option enumClassPrefix to use the classname in the enum which seems to fix it.
#6907

go-gin-server doesn't have this option. Also the go-gin-server model.mustache template looks incorrect:

  • type declaration uses "name" but the value definition is using "classname" so the generated code is invalid:
type ComparisonOperator_anyOf string

// List of ComparisonOperator_anyOf
const (
        EQ ComparisonOperatorAnyOf = "EQ"      <- this is not matching ComparisonOperator_anyOf in type declaration above
        NEQ ComparisonOperatorAnyOf = "NEQ"
        GT ComparisonOperatorAnyOf = "GT"
        GTE ComparisonOperatorAnyOf = "GTE"
        LT ComparisonOperatorAnyOf = "LT"
        LTE ComparisonOperatorAnyOf = "LTE"
)

Describe the solution you'd like

adding the enumClassPrefix option to go-gin-server resolves this

@pmcgleenon pmcgleenon changed the title [REQ] Added enumClassPrefix option to go-gin-server generation [REQ] [GO] [SERVER] Added enumClassPrefix option to go-gin-server generation Feb 11, 2021
@pmcgleenon
Copy link
Contributor Author

PR has been merged - closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant