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

Performance issue #10

Closed
sheldhur opened this issue Jul 8, 2019 · 2 comments
Closed

Performance issue #10

sheldhur opened this issue Jul 8, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@sheldhur
Copy link
Collaborator

sheldhur commented Jul 8, 2019

Hi.

openapi-request-validator is fast, because that use Ajv. Ajv compiles schemas into simple fast validation functions. This should be done once, but you create new OpenAPIRequestValidator object upon each request (https://github.com/cdimascio/express-openapi-validator/blob/master/src/middlewares/openapi.request.validator.ts#L65).

You not only lost perfomance, but also made it worse. Cache OpenAPIRequestValidator when it is created.

@cdimascio cdimascio self-assigned this Jul 8, 2019
@cdimascio cdimascio added the bug Something isn't working label Jul 8, 2019
@cdimascio
Copy link
Owner

will fix this. thanks for the issue!

@cdimascio
Copy link
Owner

This is fixed in v1.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants