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

Deterministic (seeded) enum values #5735

Open
fkling opened this issue Nov 28, 2023 · 0 comments
Open

Deterministic (seeded) enum values #5735

fkling opened this issue Nov 28, 2023 · 0 comments

Comments

@fkling
Copy link

fkling commented Nov 28, 2023

This is a follow up issue for #2272 (where it is suggested to open a new issue).

Is your feature request related to a problem? Please describe.

Some parts of the mock data generation process use their own source of randomness and are difficult to work around. Specifically the generation of enum values.

Describe the solution you'd like

The API could accept a function that returns a random value which is used instead of Math.random(). That would allow the user to make the default behavior deterministic.

Describe alternatives you've considered

Providing custom data generators for every enum type. It's impractical for larger schemas and tedious to account for schema changes.
Generators for enum values could themselves be generated with a custom codgen plugin, but that also requires an understanding of the codegen process.

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

No branches or pull requests

1 participant