mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Merge pull request #415 from postmanlabs/feature/fix-absent-pathvar-validation
Fixed issue where validation was giving INVALID_TYPE instead of MISSING_IN_REQUEST if path variable is not present in transaction.
This commit is contained in:
@@ -3245,6 +3245,11 @@ module.exports = {
|
||||
return cb(null, mismatches);
|
||||
}
|
||||
|
||||
// don't validate variable if not present in transaction
|
||||
if (!pathVar._varMatched) {
|
||||
return cb(null, mismatches);
|
||||
}
|
||||
|
||||
// assign parameter example(s) as schema examples
|
||||
this.assignParameterExamples(schemaPathVar);
|
||||
|
||||
@@ -3276,7 +3281,9 @@ module.exports = {
|
||||
|
||||
// go through required schemaPathVariables, and params that aren't found in the given transaction are errors
|
||||
_.each(schemaPathVariables, (pathVar) => {
|
||||
if (!_.find(determinedPathVariables, (param) => { return param.key === pathVar.name; })) {
|
||||
if (!_.find(determinedPathVariables, (param) => {
|
||||
return param.key === pathVar.name && param._varMatched;
|
||||
})) {
|
||||
|
||||
// assign parameter example(s) as schema examples;
|
||||
this.assignParameterExamples(pathVar);
|
||||
|
||||
Reference in New Issue
Block a user