forked from loafle/openapi-generator-original
Fix StringIndexOutOfBoundsException when generating example code for recursive model (#15601)
Fixes #15600
This commit is contained in:
@@ -695,7 +695,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
||||
if (modelMaps.get(subModel) == null) {
|
||||
oneOf = "new(" + subModel + ")";// a primitive type
|
||||
} else {
|
||||
oneOf = constructExampleCode(modelMaps.get(subModel), modelMaps, processedModelMap, depth + 1).substring(1);
|
||||
oneOf = StringUtils.removeStart(constructExampleCode(modelMaps.get(subModel), modelMaps, processedModelMap, depth + 1), "*");
|
||||
}
|
||||
return goImportAlias + "." + model + "{" + typeToName(subModel) + ": " + oneOf + "}";
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user