Skip to content

Commit

Permalink
better null check in getSchemaFromResponse (#17003)
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 authored Nov 8, 2023
1 parent ced9660 commit e950707
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1010,11 +1010,16 @@ public static Schema getSchemaFromRequestBody(RequestBody requestBody) {
* Return the first defined Schema for a ApiResponse
*
* @param openAPI OpenAPI spec.
* @param response api response of the operation
* @param response API response of the operation
* @return firstSchema
*/
public static Schema getSchemaFromResponse(OpenAPI openAPI, ApiResponse response) {
return getSchemaFromContent(getReferencedApiResponse(openAPI, response).getContent());
ApiResponse result = getReferencedApiResponse(openAPI, response);
if (result == null) {
return null;
} else {
return getSchemaFromContent(result.getContent());
}
}

/**
Expand Down

0 comments on commit e950707

Please sign in to comment.