Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

can't use middleware with swagger-restify-middleware #5

Open
terencechow opened this issue Nov 17, 2017 · 0 comments
Open

can't use middleware with swagger-restify-middleware #5

terencechow opened this issue Nov 17, 2017 · 0 comments

Comments

@terencechow
Copy link

If I have a route that needs a middleware, the restify way of doing that is with an array:

server.get('/path', [ middleWare, routeHandler])

However I can't export an array in swagger. The express solution would be to use
server.get('/path', middleware); and that would get called before your swagger operation.

However that does not happen with restify because restify seems to be consuming the route when server.get('/path', middleware) is used? (Not sure if i'm wrong about this.)

Hence I can't have route specific middleware for swagger-restify,

Is there something I'm missing? How is route specific middleware handled with swagger restify?

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

No branches or pull requests

1 participant