swagger-node-runner icon indicating copy to clipboard operation
swagger-node-runner copied to clipboard

route specific middleware for restify

Open terencechow opened this issue 8 years ago • 0 comments

This library is used in swagger-restify-mw but I am unable to have route specific middleware with restify as a result.

Restify requires route specific middleware in the following signature:

server.get('/someroute', [ middleware1, middleware2, someHandler])

However when I export an array for a route I get the error found in line 92 of swagger_router.js Specifically it looks for a controller that is of type function typeof controllerFunction === 'function'.

Hence I can't do

export const myHandler = [ authenticationMiddleware, routeHandler]

Is there a way to add route specific middleware for restify that is compatible with swagger node runner?

terencechow avatar Dec 29 '17 15:12 terencechow