mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
removed unncessary callback from convert
This commit is contained in:
8
index.js
8
index.js
@@ -59,13 +59,7 @@ module.exports = {
|
||||
reason: err
|
||||
});
|
||||
});
|
||||
}, (err) => {
|
||||
if (err) {
|
||||
return cb(null, {
|
||||
result: false,
|
||||
reason: _.toString(err.reason)
|
||||
});
|
||||
}
|
||||
}, () => {
|
||||
|
||||
var conversionResult = false,
|
||||
convertedCollections = [],
|
||||
|
||||
@@ -261,9 +261,7 @@ var sdk = require('postman-collection'),
|
||||
module.exports = {
|
||||
convert: function(json, options, callback) {
|
||||
try {
|
||||
converter.convert(json, options, (err, result) => {
|
||||
callback(null, result);
|
||||
});
|
||||
converter.convert(json, options, callback);
|
||||
}
|
||||
catch (e) {
|
||||
if (e instanceof OpenApiErr) {
|
||||
|
||||
@@ -103,14 +103,14 @@ module.exports = {
|
||||
getOasObject: function (file) {
|
||||
let oasObj = file;
|
||||
|
||||
if (typeof file === 'string') {
|
||||
if (typeof oasObj === 'string') {
|
||||
try {
|
||||
oasObj = JSON.parse(file);
|
||||
oasObj = JSON.parse(oasObj);
|
||||
}
|
||||
catch (jsonEx) {
|
||||
// Not direct JSON. Could be YAML
|
||||
try {
|
||||
oasObj = yaml.safeLoad(file);
|
||||
oasObj = yaml.safeLoad(oasObj);
|
||||
}
|
||||
catch (yamlEx) {
|
||||
// Not JSON or YAML
|
||||
|
||||
Reference in New Issue
Block a user