Skip to content

Add initialism-overrides flag#1007

Merged
deepmap-marcinr merged 3 commits intooapi-codegen:masterfrom
shiv3:feature_add_initializm-flag
May 5, 2023
Merged

Add initialism-overrides flag#1007
deepmap-marcinr merged 3 commits intooapi-codegen:masterfrom
shiv3:feature_add_initializm-flag

Conversation

@shiv3
Copy link
Copy Markdown
Contributor

@shiv3 shiv3 commented Mar 20, 2023

Fixes #454 and #573
The PR still announced it needed to be implemented as a command option, so I reworked the implementation.

@deepmap-marcinr deepmap-marcinr merged commit 78c53fd into oapi-codegen:master May 5, 2023
@shiv3 shiv3 deleted the feature_add_initializm-flag branch May 7, 2023 01:40
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
* Add initialism-overrides flag

* Add testcase

* FIx option
jamietanna added a commit that referenced this pull request May 4, 2024
…sms)

As noted in #454, the generated code we produce defaults to performing
`CamelCase` - which is fine - but doesn't take into account common
initialisms that are idiomatic to Go.

This was previously attempted in #1007, but we had to roll it back due
to it changing underlying generated code, which would result in a
breaking change for consumers.

To avoid this, we can make this opt-in via a new output option,
`name-normalizer`, which provides the ability to control the
functionality.

This is also available for folks using the project as a library, which
makes it more convenient to change behaviour.

Closes #454.

Co-authored-by: Dmitriy Lukiyanchuk <dmitriy.lukiyanchuk@instamart.ru>
Co-authored-by: Jamie Tanna <jamie@jamietanna.co.uk>
Co-authored-by: Jamie Tanna <jamie.tanna@elastic.co>
adrianpk added a commit to foorester/oapi-codegen that referenced this pull request May 31, 2024
* Add initialism-overrides flag

* Add testcase

* FIx option
danicc097 pushed a commit to danicc097/oapi-codegen that referenced this pull request Aug 31, 2024
* Add initialism-overrides flag

* Add testcase

* FIx option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Respect initialisms for schema generation

2 participants