mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 03:18:53 +00:00
Fix NPEs in Java generator (#154)
This commit is contained in:
parent
4d7ff8cfbd
commit
7db0201a89
@ -1459,7 +1459,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
// parent model
|
// parent model
|
||||||
final String parentName = getParentName(composed, allDefinitions);
|
final String parentName = getParentName(composed, allDefinitions);
|
||||||
final Schema parent = StringUtils.isBlank(parentName) ? null : allDefinitions.get(parentName);
|
final Schema parent = StringUtils.isBlank(parentName) || allDefinitions == null ? null : allDefinitions.get(parentName);
|
||||||
|
|
||||||
List<Schema> interfaces = getInterfaces(composed);
|
List<Schema> interfaces = getInterfaces(composed);
|
||||||
|
|
||||||
@ -4097,7 +4097,12 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
codegenParameter.isListContainer = true;
|
codegenParameter.isListContainer = true;
|
||||||
codegenParameter.description = s.getDescription();
|
codegenParameter.description = s.getDescription();
|
||||||
codegenParameter.dataType = getTypeDeclaration(s);
|
codegenParameter.dataType = getTypeDeclaration(s);
|
||||||
codegenParameter.datatypeWithEnum = codegenParameter.dataType.replace(codegenParameter.baseType, codegenParameter.enumName);
|
if (codegenParameter.baseType != null && codegenParameter.enumName != null){
|
||||||
|
codegenParameter.datatypeWithEnum = codegenParameter.dataType.replace(codegenParameter.baseType, codegenParameter.enumName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LOGGER.warn("Could not compute datatypeWithEnum from " + codegenParameter.baseType + ", " + codegenParameter.enumName);
|
||||||
|
}
|
||||||
//TODO fix collectformat for form parameters
|
//TODO fix collectformat for form parameters
|
||||||
//collectionFormat = getCollectionFormat(s);
|
//collectionFormat = getCollectionFormat(s);
|
||||||
// default to csv:
|
// default to csv:
|
||||||
|
Loading…
Reference in New Issue
Block a user