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

Is there any reason to schema-generators.generators/default-leaf-generators does not be called in schema-generators.complete/complete? #26

Open
gilvan-reis opened this issue Apr 7, 2022 · 1 comment

Comments

@gilvan-reis
Copy link

Hi, I am getting the error You must provide a leaf generator for schema.spec.leaf.LeafSpec@2bd8c7ed when calling the schema-generators.complete/complete for a given schema, but when I call schema-generators.generators/generate for the same schema it work without need to pass any additional leaf generator.

Looking at the code, I have found the default-leaf-generators (source) that is only called in the generate.

Is there any reason for that?

Could we add those default leaf generators to complete in order to both work with the same types?

@w01fe
Copy link
Member

w01fe commented Apr 8, 2022

Thanks for the question.

When creating a test DSL with completers, you might want to e.g. always require certain fields to be present. If we automatically supply the leaf generators, you don't have that flexibility. On the other hand, I think it's always easy for you to supply the defaults yourself, or make your own wrapper that supplies the defaults by default.

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

2 participants