diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index fafe588a90..1d530d859f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1610,10 +1610,10 @@ public class DefaultCodegen implements CodegenConfig { } if (p.getEnum() != null) { - List _enum = p.getEnum(); + List _enum = p.getEnum(); property._enum = new ArrayList(); - for (Integer i : _enum) { - property._enum.add(i.toString()); + for (Object i : _enum) { + property._enum.add(String.valueOf(i)); } property.isEnum = true; allowableValues.put("values", _enum); @@ -1679,10 +1679,10 @@ public class DefaultCodegen implements CodegenConfig { } if (p.getEnum() != null && !p.getEnum().isEmpty()) { - List _enum = p.getEnum(); + List _enum = p.getEnum(); property._enum = new ArrayList(); - for (Number i : _enum) { - property._enum.add(i.toString()); + for (Object i : _enum) { + property._enum.add(String.valueOf(i)); } property.isEnum = true;