Make sure that request body has 'schema' property before checking for type and format

This commit is contained in:
Ankit Saini
2021-10-04 13:42:17 +05:30
parent 517f5714ee
commit 0cbbe028cd

View File

@@ -1875,7 +1875,7 @@ module.exports = {
if (
bodyType &&
contentObj[bodyType].hasOwnProperty('schema') &&
!_.isEmpty(_.get(contentObj, [bodyType, 'schema'])) &&
contentObj[bodyType].schema.type === 'string' &&
contentObj[bodyType].schema.format === 'binary'
) {