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

Configure Maximum Ticks for Static Generation through the Environment #2554

Open
AbdulelahHajjar opened this issue Jul 3, 2024 · 1 comment

Comments

@AbdulelahHajjar
Copy link

Context

Prism static mock generation has a max tick of "2500" where if the schema exceeds this tick amount, Prism throws SCHEMA_TOO_COMPLEX error.

The proposed change is to allow the Prism user to configure the maximum ticks through the environment to allow for larger schemas to be generated.

While we can use dynamic generation, we want to benefit from the deterministic, non-random output of Prism's static generation. And apply JSON patches to the responses to modify it based on our needs. This has worked very well for us for the past months, except for one large schema.

Current Behavior

If a schema is too complex (i.e., exceeds the hard-coded ticks value of 2500), the response is an error of 500 Internal Server Error

Expected Behavior

The Prism user can modify the ticks value from the environment before launching the server, thus allowing for complex schemas to be generated statically without the dynamic generation.

Possible Solution(s)

Perhaps, a key STATIC_GENERATION_MAX_TICKS or a launch argument --staticGenerationMaxTicks.

Thanks

Super thanks for the contributors of Prism, we have been using it for UI tests in a financial application and has become a key part of our testing suite!

@lukaszzazulak
Copy link
Contributor

We would welcome a PR with tests, which introduces a new command line argument.

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

No branches or pull requests

2 participants