forked from loafle/openapi-generator-original
fix NPE in R construct example (#15953)
This commit is contained in:
parent
d5c53b9812
commit
15b3addd40
@ -945,10 +945,14 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
public String constructExampleCode(CodegenProperty codegenProperty, HashMap<String, CodegenModel> modelMaps, int depth) {
|
||||
if (depth > 10) return "...";
|
||||
if (depth > 10) {
|
||||
return "...";
|
||||
}
|
||||
depth++;
|
||||
|
||||
if (codegenProperty.isArray) { // array
|
||||
if (codegenProperty == null) {
|
||||
return "TODO";
|
||||
} else if (codegenProperty.isArray) { // array
|
||||
return "c(" + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")";
|
||||
} else if (codegenProperty.isMap) { // map
|
||||
return "c(key = " + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")";
|
||||
|
Loading…
x
Reference in New Issue
Block a user