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.
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.