Skip to content

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

@pmcgleenon

Description

@pmcgleenon

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions