Fixed issue where nested objects present in parameters caused validation mismatches

This commit is contained in:
Vishal Shingala
2021-04-26 19:07:38 +05:30
parent 92b2741a01
commit a4175720a0
4 changed files with 250 additions and 0 deletions

View File

@@ -2873,6 +2873,13 @@ module.exports = {
let reason = '',
mismatchObj;
// exclude mismatch errors for nested objects in parameters (at this point simple objects and array should
// be already converted to primitive schema and only nested objects remains as type object/array)
if (_.includes(['QUERYPARAM', 'PATHVARIABLE', 'HEADER'], property) &&
(schema.type === 'object' || schema.type === 'array')) {
return callback(null, []);
}
if (property === 'RESPONSE_BODY' || property === 'BODY') {
// we don't have names for the body, but there's only one
reason = 'The ' + humanPropName;