apigee-127 / swagger-node-runner

The heart of Swagger-Node
MIT License
102 stars 123 forks source link

route specific middleware for restify #116

Open terencechow opened 6 years ago

terencechow commented 6 years ago

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?