Skip to content

Commit 7ef87f1

Browse files
committed
use object for undefined types
1 parent 5e46b20 commit 7ef87f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/io/swagger/codegen/v3/generators/javascript/JavaScriptClientCodegen.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.util.Iterator;
3939
import java.util.List;
4040
import java.util.Map;
41+
import java.util.regex.Pattern;
4142

4243
import static io.swagger.codegen.v3.CodegenConstants.HAS_ENUMS_EXT_NAME;
4344
import static io.swagger.codegen.v3.CodegenConstants.IS_ENUM_EXT_NAME;
@@ -505,6 +506,9 @@ public String toParamName(String name) {
505506

506507
@Override
507508
public String toModelName(String name) {
509+
if (name == null) {
510+
return "Object";
511+
}
508512
name = sanitizeName(name); // FIXME parameter should not be assigned. Also declare it as "final"
509513

510514
if (!StringUtils.isEmpty(modelNamePrefix)) {

0 commit comments

Comments
 (0)