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

Support default for enum fields #2544

Open
2 tasks
pjoe opened this issue May 10, 2024 · 2 comments
Open
2 tasks

Support default for enum fields #2544

pjoe opened this issue May 10, 2024 · 2 comments
Labels

Comments

@pjoe
Copy link

pjoe commented May 10, 2024

Describe the feature you'd like to request

The enum type doesn't currently support defining default value, e.g. this will not work:

a.enum(["a", "b"]).default("a")

Describe the solution you'd like

Code like above works, just like with other field types.

Describe alternatives you've considered

Had to use another field type (boolean or integer)

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change
@AnilMaktala
Copy link

Hi @pjoe , Thank you for rasing this. we are marking this as a feature request for the team to evaluate further.

@AnilMaktala AnilMaktala added feature-request New feature or request Gen 2 and removed pending-triage labels May 10, 2024
@thomasoehri
Copy link

I would also be interested in this being supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants