OpenAPITools / OpenAPITools/openapi-generator

[REQ] [Go] Support acronyms on model names

Open
#2,740 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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

Using the Go generator with a model called IAMLDAPConfiguration, the type name which gets generated is IamldapConfiguration, which doesn't look great. In this specific case IAM is an acronym for our Identity and Access Management API, and LDAP is the protocol.

Describe the solution you'd like

I'd expect a way to enforce a given name for generated models. Here I'd rather have the model type called IAMLDAPConfiguration.

Describe alternatives you've considered

I could also call the model IamLdapConfiguration in my spec, it would then get generated as is and it looks a bit better, but still not as good as IAMLDAPConfiguration.

It also follows the Go convention, see https://github.com/golang/go/wiki/CodeReviewComments#initialisms

cc @wing328

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is named in the issue. Start by locating the Go generator's model-name conversion and configuration handling, then verify the generated name for IAMLDAPConfiguration; done means a supported way to preserve the requested acronym casing in the Go model type.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.