forked from loafle/openapi-generator-original
better null check in default codegen (#13264)
This commit is contained in:
parent
1a5d3926b3
commit
3a2b4b9bdd
@ -6926,6 +6926,10 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
final ArraySchema arraySchema = (ArraySchema) schema;
|
||||
Schema inner = getSchemaItems(arraySchema);
|
||||
CodegenProperty codegenProperty = fromProperty("property", arraySchema, false);
|
||||
if (codegenProperty == null) {
|
||||
throw new RuntimeException("CodegenProperty cannot be null. arraySchema for debugging: " + arraySchema);
|
||||
}
|
||||
|
||||
if (!addSchemaImportsFromV3SpecLocations) {
|
||||
imports.add(codegenProperty.baseType);
|
||||
}
|
||||
@ -6943,6 +6947,10 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
innerCp = innerCp.items;
|
||||
}
|
||||
|
||||
if (mostInnerItem == null) {
|
||||
throw new RuntimeException("mostInnerItem (codegen property of array item) cannot be null. " + arraySchema);
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(bodyParameterName)) {
|
||||
if (StringUtils.isEmpty(mostInnerItem.complexType)) {
|
||||
codegenParameter.baseName = "request_body";
|
||||
|
Loading…
x
Reference in New Issue
Block a user