forked from loafle/openapi-generator-original
better null check in getSchemaFromResponse (#17003)
This commit is contained in:
parent
ced9660123
commit
e9507077fc
@ -1010,11 +1010,16 @@ public class ModelUtils {
|
||||
* 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());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user