mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
29 lines
553 B
JavaScript
29 lines
553 B
JavaScript
'use strict';
|
|
|
|
const SchemaPack = require('./lib/schemapack.js').SchemaPack;
|
|
|
|
module.exports = {
|
|
// Old API wrapping the new API
|
|
convert: function(input, options, cb) {
|
|
var schema = new SchemaPack(input, options);
|
|
|
|
if (schema.validated) {
|
|
return schema.convert(cb);
|
|
}
|
|
|
|
return cb(null, schema.validationResult);
|
|
},
|
|
|
|
validate: function(input) {
|
|
var schema = new SchemaPack(input);
|
|
return schema.validationResult;
|
|
},
|
|
|
|
getOptions: function() {
|
|
return SchemaPack.getOptions();
|
|
},
|
|
|
|
// new API
|
|
SchemaPack
|
|
};
|