You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw this issue #114 and the resulting PR, which lazy loads schemas, which is great for environments like AWS Lambda.
There is now a new method in AJV 8 to generate the schemas to JS functions at compile time so that they can be used at runtime, no more compiling schemas at runtime which saves a lot of time. You can read more about the process here: https://ajv.js.org/standalone.html and I also wrote a blog about it here: https://www.rehanvdm.com/blog/typescript-type-safety-with-ajv-standalone. . Fastify also added the option recently, might be worth seeing their implementation.
One of the main reasons I chose this package is because it uses AJV for validation instead of the other validation libraries that can be slow.
The text was updated successfully, but these errors were encountered:
So I have a 3000 lines Open API spec that takes about 7 seconds to load on a AWS Lambda @1024mb when quick is set to false 😲. With quick true it takes about 80ms, and then the input (path, query, body) validation about 100ms and the response about 10ms. That only happens the first time so the quick option is doing its job. I still feel that it can be improved by using the standalone mode.
Do you have any plans to maybe tackle this within the next few weeks/months/roadmap? Do you think it would be possible to somehow use the customizeAjv function when creating the OpenAPIBackend object to load the schemas in there then?
I saw this issue #114 and the resulting PR, which lazy loads schemas, which is great for environments like AWS Lambda.
There is now a new method in AJV 8 to generate the schemas to JS functions at compile time so that they can be used at runtime, no more compiling schemas at runtime which saves a lot of time. You can read more about the process here: https://ajv.js.org/standalone.html and I also wrote a blog about it here: https://www.rehanvdm.com/blog/typescript-type-safety-with-ajv-standalone. . Fastify also added the option recently, might be worth seeing their implementation.
One of the main reasons I chose this package is because it uses AJV for validation instead of the other validation libraries that can be slow.
The text was updated successfully, but these errors were encountered: