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

[BUG][Go] respect initialisms or acronyms in names #4833

Closed
jirikuncar opened this issue Dec 18, 2019 · 2 comments · Fixed by #15083
Closed

[BUG][Go] respect initialisms or acronyms in names #4833

jirikuncar opened this issue Dec 18, 2019 · 2 comments · Fixed by #15083

Comments

@jirikuncar
Copy link
Contributor

Description

Names in generated Go clients do not respect recommended style.

Url -> URL
Id -> ID
Http -> HTTP
openapi-generator version

all

Related issues/PRs

https://github.com/golang/go/wiki/CodeReviewComments#initialisms

Suggest a fix

Override GoExperimentalCodegen.toParamName method.

@wing328
Copy link
Member

wing328 commented Dec 19, 2019

There were discussions on this before. I think the best way is to provide an option allowing users to provide a mapping (e.g. HTTP => Http) on special words that need to be handled differently.

@displague
Copy link

Anti-match maps should also be considered when implementing initialisms to handle edge cases. cURL, for example.

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