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

Option to ignore enum constraints #2312

Open
adam-iris opened this issue Feb 8, 2025 · 0 comments
Open

Option to ignore enum constraints #2312

adam-iris opened this issue Feb 8, 2025 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@adam-iris
Copy link

Is your feature request related to a problem? Please describe.
I'm trying to create a client for an API whose json schema includes enums that may be expanded without warning. This appears to violate best practices (see https://opensource.zalando.com/restful-api-guidelines/#112) but I don't really have sway over the schema authors, and I think a robust client should be prepared for this (see https://opensource.zalando.com/restful-api-guidelines/#108).

Describe the solution you'd like
A command line flag that causes enum constraints to be ignored; the generated code would simply use the defined type (eg. "string").

Describe alternatives you've considered
I'm currently modifying the schema definition to replace "enum" with "x-extensible-enum" as described at https://opensource.zalando.com/restful-api-guidelines/#112
The code generator appears to ignore "x-extensible-enum" entirely, which produces the desired result, but this doesn't seem like a sustainable strategy moving forward.

Additional context

@gaborbernat gaborbernat added enhancement New feature or request help wanted Extra attention is needed labels Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants