Add initialism-overrides flag#1007
Merged
deepmap-marcinr merged 3 commits intooapi-codegen:masterfrom May 5, 2023
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #454 and #573
The PR still announced it needed to be implemented as a command option, so I reworked the implementation.