Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const upload = multer({ storage: storage });
const fetch = require('node-fetch');
const yaml = require('yaml');
const converter = require('swagger2openapi');
const validator = require('oas-validator');
const s2oVersion = require('swagger2openapi/package.json').version;
const recurse = require('reftools/lib/recurse.js').recurse;
var status = {};
status.startTime = new Date();
status.conversions = 0;
status.validations = 0;
status.badges = 0;
status.targetVersion = converter.targetVersion;
status.s2oVersion = s2oVersion;
status.self = require('./package.json');
function getObj(body,payload){
var obj = {};
try {
obj = JSON.parse(body);
}
catch(ex) {
try {
obj = yaml.parse(body);
payload.yaml = true;
}
catch(ex) {
console.log(body);
}