mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
added validation for folder
This commit is contained in:
8
index.js
8
index.js
@@ -120,6 +120,14 @@ module.exports = {
|
||||
data = fs.readFileSync(input.data).toString();
|
||||
return validate(data);
|
||||
}
|
||||
else if (input.type === 'folder') {
|
||||
if (!_.isEmpty(parse.getRootFiles(input.data))) {
|
||||
return {
|
||||
result: true,
|
||||
reason: 'valid input type'
|
||||
};
|
||||
}
|
||||
}
|
||||
return {
|
||||
result: false,
|
||||
reason: 'input type is not valid'
|
||||
|
||||
Reference in New Issue
Block a user