mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Validate the version input
Validate the version input
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
const { ParseError } = require('./common/ParseError.js');
|
||||
|
||||
const { formatDataPath, checkIsCorrectType, isKnownType } = require('./common/schemaUtilsCommon.js'),
|
||||
{ getConcreteSchemaUtils, SWAGGER_VERSION } = require('./common/versionUtils.js'),
|
||||
{ getConcreteSchemaUtils, SWAGGER_VERSION, validateSupportedVersion } = require('./common/versionUtils.js'),
|
||||
async = require('async'),
|
||||
sdk = require('postman-collection'),
|
||||
schemaFaker = require('../assets/json-schema-faker.js'),
|
||||
@@ -4986,6 +4986,9 @@ module.exports = {
|
||||
if (processInput.data[0].path === '') {
|
||||
throw new Error('"Path" of the data element should be provided');
|
||||
}
|
||||
if (processInput.specificationVersion && !validateSupportedVersion(processInput.specificationVersion)) {
|
||||
throw new Error(`The provided version "${processInput.specificationVersion}" is not valid`);
|
||||
}
|
||||
},
|
||||
MULTI_FILE_API_TYPE_ALLOWED_VALUE
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user