forked from loafle/openapi-generator-original
better null check for response (#9105)
This commit is contained in:
parent
ab6c6962c2
commit
8d372fa66a
@ -813,11 +813,13 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
schemas.put(opId, requestSchema);
|
schemas.put(opId, requestSchema);
|
||||||
}
|
}
|
||||||
// process all response bodies
|
// process all response bodies
|
||||||
for (Map.Entry<String, ApiResponse> ar : op.getValue().getResponses().entrySet()) {
|
if (op.getValue().getResponses() != null) {
|
||||||
ApiResponse a = ModelUtils.getReferencedApiResponse(openAPI, ar.getValue());
|
for (Map.Entry<String, ApiResponse> ar : op.getValue().getResponses().entrySet()) {
|
||||||
Schema responseSchema = ModelUtils.getSchemaFromResponse(a);
|
ApiResponse a = ModelUtils.getReferencedApiResponse(openAPI, ar.getValue());
|
||||||
if (responseSchema != null) {
|
Schema responseSchema = ModelUtils.getSchemaFromResponse(a);
|
||||||
schemas.put(opId + ar.getKey(), responseSchema);
|
if (responseSchema != null) {
|
||||||
|
schemas.put(opId + ar.getKey(), responseSchema);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user