Skip to content

Add literals alongside enums - #1016

Closed
theorm wants to merge 3 commits into
openapi-generators:mainfrom
theorm:main
Closed

theorm wants to merge 3 commits into
openapi-generators:mainfrom
theorm:main

Conversation

@theorm

@theorm theorm commented Mar 29, 2024

Copy link
Copy Markdown

Generating literal types alongside string and int Enums. We really need it in our code so have this in our custom templates. I thought there are others who would like to have it in the default template.

@dbanty

dbanty commented Apr 19, 2024

Copy link
Copy Markdown
Collaborator

Are you using literals instead of enums? Is there a particular limitation of enums that makes that necessary? Trying to understand if this should be an option in config (to generate literals instead) or if it makes sense to completely replace enums with literals 🤔

@theorm

theorm commented Apr 27, 2024

Copy link
Copy Markdown
Author

We are using literals instead of enums in a public library with a lot of choice parameters where having enums would mean a lot of typing for the user and generally more noise in the code. There are still many developers out there who prefer to use enums instead of literals, so making it configurable would be a much better option!

@theorm

theorm commented Jul 19, 2024

Copy link
Copy Markdown
Author

Replaced by #1076

@theorm theorm closed this Jul 19, 2024
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.

2 participants