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] Added enumClassPrefix option to go-gin-server. Used same appro… #8681

Merged
merged 2 commits into from
Feb 16, 2021
Merged

Conversation

pmcgleenon
Copy link
Contributor

@pmcgleenon pmcgleenon commented Feb 11, 2021

#8680 (go-server)

Added enumClassPrefix option for go-gin-server target. This option already exists in go-server.
Fixed a bug in the model.mustache where name is used in the type declaration and classname is used in the definition

generated code before:

`type ComparisonOperator_anyOf string

// List of ComparisonOperator_anyOf
const (
        EQ ComparisonOperatorAnyOf = "EQ"
        NEQ ComparisonOperatorAnyOf = "NEQ"
        GT ComparisonOperatorAnyOf = "GT"
        GTE ComparisonOperatorAnyOf = "GTE"
        LT ComparisonOperatorAnyOf = "LT"
        LTE ComparisonOperatorAnyOf = "LTE"
)`

generated code after:

`type ComparisonOperatorAnyOf string

// List of ComparisonOperatorAnyOf
const (
        COMPARISONOPERATORANYOF_EQ ComparisonOperatorAnyOf = "EQ"
        COMPARISONOPERATORANYOF_NEQ ComparisonOperatorAnyOf = "NEQ"
        COMPARISONOPERATORANYOF_GT ComparisonOperatorAnyOf = "GT"
        COMPARISONOPERATORANYOF_GTE ComparisonOperatorAnyOf = "GTE"
        COMPARISONOPERATORANYOF_LT ComparisonOperatorAnyOf = "LT"
        COMPARISONOPERATORANYOF_LTE ComparisonOperatorAnyOf = "LTE"
)`

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master, 5.1.x, 6.0.x
  • [ x] If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@antihax (2017/11) @grokify (2018/07) @kemokemo (2018/09) @jirikuncar (2021/01)

…ch as #7008 (go-server)

	modified:   docs/generators/go-gin-server.md
	modified:   modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java
	modified:   modules/openapi-generator/src/main/resources/go-gin-server/model.mustache
@pmcgleenon pmcgleenon changed the title [REQ] Added enumClassPrefix option to go-gin-server. Used same appro… [REQ] [GO] Added enumClassPrefix option to go-gin-server. Used same appro… Feb 11, 2021
@kemokemo
Copy link
Contributor

@pmcgleenon
Thank you so much for your PR!
A short review was conducted. LGTM. ( related #7008 )

@pmcgleenon
Copy link
Contributor Author

@kemokemo Thanks for the quick feedback!

@wing328 wing328 added this to the 5.1.0 milestone Feb 16, 2021
@wing328 wing328 merged commit 3c4015b into OpenAPITools:master Feb 16, 2021
@wing328
Copy link
Member

wing328 commented Mar 22, 2021

@pmcgleenon thanks for the PR, which has been included in the v5.1.0 release: https://twitter.com/oas_generator/status/1373636654024380423

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

Successfully merging this pull request may close these issues.

None yet

3 participants