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

Allow async handlers #138

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

juliusza
Copy link

Allows route handlers to be async functions

Based on https://medium.com/@Abazhenov/using-async-await-in-express-with-node-8-b8af872c0016

Or see README for more info

@jsdevel
Copy link

jsdevel commented Jan 27, 2018

FYI, express-openapi supports this.

@juliusza
Copy link
Author

Thanks, I will look into that lib.

@juliusza
Copy link
Author

juliusza commented Mar 6, 2018

Is there a reason not to accept this PR though ? express-openapi does not work out of the box for me, I'd rather stick with swaggerize-express

@jsdevel
Copy link

jsdevel commented Mar 6, 2018

express-openapi does not work out of the box for me

@juliusza what issue were you having? Can you open one? https://github.com/kogosoftwarellc/express-openapi/issues

@juliusza
Copy link
Author

juliusza commented Mar 8, 2018

ok, how about this one?
kogosoftwarellc/open-api#91

@tlivings
Copy link
Contributor

tlivings commented Mar 8, 2018

Will review. Kraken team has been under a lot of resource constraints and it’s been hard to turn around PRs. Apologies.

@tlivings
Copy link
Contributor

tlivings commented Mar 8, 2018

Can you add some tests?

@tlivings
Copy link
Contributor

tlivings commented Mar 8, 2018

Also, for what it’s worth at this point https://github.com/krakenjs/hapi-openapi is more actively maintained. Unless you have some overriding preference for express applications.

@juliusza
Copy link
Author

juliusza commented Mar 8, 2018

I hope test is satisfactory. Please also bump major version to 5.0.0, because this now requires native Promise support and might not work for very old nodejs versions.

Tests now require node v8 to run. But node 4.8.7 is enough for lib to work correctly.

@juliusza
Copy link
Author

juliusza commented Mar 8, 2018

Also do you think you could bump enjoi version ?

krakenjs/swaggerize-routes#94

Copy link
Contributor

@tlivings tlivings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have much of an issue with this. @subeeshcbabu ?

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

Successfully merging this pull request may close these issues.

3 participants