@@ -22,7 +22,7 @@ const _ = require('lodash'),
2222 ajvValidationError = require ( '../lib/ajValidation/ajvValidationError' ) ,
2323 { validateSchema } = require ( '../lib/ajValidation/ajvValidation' ) ,
2424 { formatDataPath, checkIsCorrectType, isKnownType,
25- getServersPathVars } = require ( '../lib/common/schemaUtilsCommon.js' ) ,
25+ getServersPathVars, DEFAULT_RESPONSE_CODE_IN_OAS } = require ( '../lib/common/schemaUtilsCommon.js' ) ,
2626
2727 { findMatchingRequestFromSchema, isPmVariable } = require ( './requestMatchingUtils' ) ,
2828
@@ -2424,7 +2424,7 @@ function checkResponses (context, transaction, transactionPathPrefix, schemaPath
24242424 // loop through all responses
24252425 // for each response, find the appropriate response from schemaPath, and then validate response body and headers
24262426 async . map ( responses , ( response , responseCallback ) => {
2427- let thisResponseCode = _ . toString ( response . code ) ,
2427+ let thisResponseCode = _ . toString ( response . code ) || DEFAULT_RESPONSE_CODE_IN_OAS ,
24282428 thisSchemaResponse = _ . get ( schemaPath , [ 'responses' , thisResponseCode ] , _ . get ( schemaPath , 'responses.default' ) ) ,
24292429 responsePathPrefix = thisResponseCode ;
24302430
@@ -2503,8 +2503,6 @@ function checkResponses (context, transaction, transactionPathPrefix, schemaPath
25032503 missingResponses = [ ] ;
25042504
25052505 _ . each ( _ . get ( schemaPath , 'responses' ) , ( responseObj , responseCode ) => {
2506- responseCode = responseCode === 'default' ? '500' : responseCode ;
2507-
25082506 if ( ! _ . includes ( matchedResponses , responseCode ) ) {
25092507 let mismatchObj = {
25102508 property : 'RESPONSE' ,
0 commit comments