Skip to content

Commit

Permalink
Fix issue when a response was an array and response body was not matc…
Browse files Browse the repository at this point in the history
…hing properly
  • Loading branch information
en-milie committed Nov 9, 2020
1 parent 5e8edf4 commit 1b3461a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,12 @@ private String extractResponseSchemaRef(Operation operation, String responseCode
return apiResponse.get$ref();
}
if (apiResponse.getContent() != null && apiResponse.getContent().get(MimeTypeUtils.APPLICATION_JSON_VALUE) != null) {
return apiResponse.getContent().get(MimeTypeUtils.APPLICATION_JSON_VALUE).getSchema().get$ref();
Schema respSchema = apiResponse.getContent().get(MimeTypeUtils.APPLICATION_JSON_VALUE).getSchema();
if (respSchema instanceof ArraySchema) {
return ((ArraySchema) respSchema).getItems().get$ref();
} else {
return respSchema.get$ref();
}
}
return null;
}
Expand Down

0 comments on commit 1b3461a

Please sign in to comment.