Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function Exception(err, name){
if(err instanceof Error){
this.message = err.message;
this.name = name || err.name;
require('traverse')(err).forEach(function(){
if(this.circular) this.remove();
})
this.cause = err;
//this.cause = err;
//delete this.cause.domain;
}
else{
this.message = err;
this.name = name || '';
}
}
util.inherits(Exception, Error);
.on('finish', function () {
traverse.forEach(completeApi, function (value) {
if (this.key === '$ref' && fileToType[value]) {
this.update('#/definitions/' + fileToType[value]);
}
});
var out = 'dist/model/openapi';
fse.mkdirsSync(out);
fs.writeFileSync(path.resolve(out, 'api.json'), JSON.stringify(restApi, null, 2));
fs.writeFileSync(path.resolve(out, 'api.yaml'), yaml.stringify(restApi, 6, 2));
fs.writeFileSync(path.resolve(out, 'complete-api.json'), JSON.stringify(completeApi, null, 2));
fs.writeFileSync(path.resolve(out, 'complete-api.yaml'), yaml.stringify(completeApi, 6, 2));
});
});
.on('finish', function () {
traverse.forEach(completeApi, function (value) {
if (this.key === '$ref' && fileToType[value]) {
this.update('#/definitions/' + fileToType[value]);
}
});
var out = path.resolve(dest, 'model/openapi');
fse.mkdirsSync(out);
fs.writeFileSync(path.resolve(out, 'api.json'), JSON.stringify(restApi, null, 2));
fs.writeFileSync(path.resolve(out, 'api.yaml'), yaml.stringify(restApi, 6, 2));
fs.writeFileSync(path.resolve(out, 'complete-api.json'), JSON.stringify(completeApi, null, 2));
fs.writeFileSync(path.resolve(out, 'complete-api.yaml'), yaml.stringify(completeApi, 6, 2));
});
});
async.map(documents, function(document, cb) {
if (docCount === 0 || (docCount > 0 && (traverseFound || geoFound))) {
traverse.forEach(document, function(x) {
if (x && typeof x === 'object' && x.hasOwnProperty('value')) {
traverseFound = true;
this.update(x.value);
}
});
docCount++;
}
return cb(null);
}, function() {
var d = domain.create();