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

Support for Asynchronous Custom Keywords in openapi-request-validator #889

Open
kwakwaversal opened this issue Sep 29, 2023 · 0 comments
Open

Comments

@kwakwaversal
Copy link

I'm currently using express-openapi and openapi-request-validator to validate API requests. I'm interested in leveraging custom keywords for validation but noticed in the documentation that asynchronous keywords are not supported:

Each key is the name of a custom keyword. Each value is an AJV keyword definition. Asynchronous keywords are not supported!

Could you provide some background on why async/await is not supported for custom keywords? Is it a design decision or an oversight that could be addressed in a future release?

Proposed Changes

I've looked into the code and have some suggestions on how this could be implemented:

  1. Make the validation method in openapi-request-validator asynchronous.
  2. Add .then/.catch blocks to handle the asynchronous operation in express-openapi around line 134.

I'd be happy to contribute these changes if you think they would be valuable for the project.

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

No branches or pull requests

1 participant