better null check for response (#9105)

This commit is contained in:
William Cheng 2021-03-29 12:05:17 +08:00 committed by GitHub
parent ab6c6962c2
commit 8d372fa66a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -813,6 +813,7 @@ public class DefaultCodegen implements CodegenConfig {
schemas.put(opId, requestSchema);
}
// process all response bodies
if (op.getValue().getResponses() != null) {
for (Map.Entry<String, ApiResponse> ar : op.getValue().getResponses().entrySet()) {
ApiResponse a = ModelUtils.getReferencedApiResponse(openAPI, ar.getValue());
Schema responseSchema = ModelUtils.getSchemaFromResponse(a);
@ -823,6 +824,7 @@ public class DefaultCodegen implements CodegenConfig {
}
}
}
}
// also add all properties of all schemas to be checked for oneOf
Map<String, Schema> propertySchemas = new HashMap<String, Schema>();