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

feat: Add lazyCompileValidationSchemas option #497

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

psznm
Copy link

@psznm psznm commented Jun 27, 2024

Added lazyCompileValidationSchemas option which enables to compile validation schemas when actually needing them. This may speed up application startup dramatically depending on the API size.

I implemented this by wrapping the validate function in a getter. I could not just replace the validate function because ajv does some weird stuff with having properties on a function. I am not confident replacing that with anything, so wrapping it in getter seemed like only reasonable option.

The option is disabled by default, as to not change behavior for existing users, so that it can be released as minor or even patch version.

@jwalton jwalton merged commit 44fd964 into exegesis-js:master Jun 27, 2024
@jwalton
Copy link
Contributor

jwalton commented Jun 27, 2024

Thanks for this!

Copy link

🎉 This PR is included in version 4.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants