Validate if the input version is supported

Validate if the input version is supported
This commit is contained in:
Luis Tejeda
2022-06-15 18:08:34 -05:00
parent 6e192043d3
commit 0b78cf18a5
4 changed files with 83 additions and 3 deletions

View File

@@ -6,7 +6,7 @@
const { ParseError } = require('./common/ParseError.js');
const { formatDataPath, checkIsCorrectType, isKnownType } = require('./common/schemaUtilsCommon.js'),
{ getConcreteSchemaUtils, isSwagger } = require('./common/versionUtils.js'),
{ getConcreteSchemaUtils, isSwagger, validateSupportedVersion } = require('./common/versionUtils.js'),
async = require('async'),
sdk = require('postman-collection'),
schemaFaker = require('../assets/json-schema-faker.js'),
@@ -4994,6 +4994,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
};