forked from loafle/openapi-generator-original
fix numeric enum throwing npe
This commit is contained in:
parent
113e8ad9fd
commit
01e1fb2415
@ -1610,10 +1610,10 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (p.getEnum() != null) {
|
if (p.getEnum() != null) {
|
||||||
List<Integer> _enum = p.getEnum();
|
List<Object> _enum = p.getEnum();
|
||||||
property._enum = new ArrayList<String>();
|
property._enum = new ArrayList<String>();
|
||||||
for (Integer i : _enum) {
|
for (Object i : _enum) {
|
||||||
property._enum.add(i.toString());
|
property._enum.add(String.valueOf(i));
|
||||||
}
|
}
|
||||||
property.isEnum = true;
|
property.isEnum = true;
|
||||||
allowableValues.put("values", _enum);
|
allowableValues.put("values", _enum);
|
||||||
@ -1679,10 +1679,10 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (p.getEnum() != null && !p.getEnum().isEmpty()) {
|
if (p.getEnum() != null && !p.getEnum().isEmpty()) {
|
||||||
List<Number> _enum = p.getEnum();
|
List<Object> _enum = p.getEnum();
|
||||||
property._enum = new ArrayList<String>();
|
property._enum = new ArrayList<String>();
|
||||||
for (Number i : _enum) {
|
for (Object i : _enum) {
|
||||||
property._enum.add(i.toString());
|
property._enum.add(String.valueOf(i));
|
||||||
}
|
}
|
||||||
property.isEnum = true;
|
property.isEnum = true;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user