Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function createFitting(pipes, fittingDef) {
assert(fittingDef.url, util.format('url is required on fitting: %j', fittingDef));
var client = require('swagger-client');
var swagger = new client.SwaggerClient({
url: fittingDef.url,
success: function() {
debug('swaggerjs initialized');
},
failure: function(err) {
console.log('swaggerjs', err); // todo: what?
},
progress: function(msg) {
debug('swaggerjs', msg);
}
});
swagger.build();
return function(context, next) {
var api = swagger.apis[context.input.api];
var operation = api[context.input.operation];