apigee-127 / swagger-node-runner

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

express middleware as fitting? #75

Open rhbecker opened 7 years ago

rhbecker commented 7 years ago

Hey, I have some express middleware I typically use with my express apps, for things like request and error logging. From tidbits I picked up in other issues, I've got it working by deactivating the error handler fitting and adding app.use() statements inside the callback passed in to SwaggerExpress.create().

However, I noticed that you had some experimental code in the bagpipes library that creates a connect-middleware fitting type. I'm interested in the idea of using existing middleware as a fitting, and messed around a bit, modifying index.js in this repo to add a connectMiddlewareDirs property to the pipesConfig object, and otherwise paralleling the logic that produces the value fed into the userFittingsDirs property of that same object.

Though I made some headway, I never got my middleware fully working as a fitting, but before continuing, I figured I should ask about your intentions with that experiment, and whether you think it a good idea to support such a thing over here.

theganyo commented 7 years ago

Can you explain more about what issues you ran into? It should work... and if not, should be fixed.