File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ func (v *responseBodyValidator) ValidateResponseBody(
4646
4747 // check if the response code is in the contract
4848 foundResponse := operation .Responses .FindResponseByCode (httpCode )
49- if foundResponse != nil {
49+ if foundResponse != nil && foundResponse . Content != nil {
5050 // check content type has been defined in the contract
5151 if mediaType , ok := foundResponse .Content .Get (mediaTypeSting ); ok {
5252 validationErrors = append (validationErrors ,
@@ -64,7 +64,7 @@ func (v *responseBodyValidator) ValidateResponseBody(
6464 }
6565 } else {
6666 // no code match, check for default response
67- if operation .Responses .Default != nil {
67+ if operation .Responses .Default != nil && operation . Responses . Default . Content != nil {
6868 // check content type has been defined in the contract
6969 if mediaType , ok := operation .Responses .Default .Content .Get (mediaTypeSting ); ok {
7070 validationErrors = append (validationErrors ,
You can’t perform that action at this time.
0 commit comments