When running the generator on a schema that contains a null enum option, we get an exception:
Exception: Cannot invoke "java.lang.Integer.toString()" because "i" is null
at io.swagger.codegen.v3.DefaultGenerator.processOperation(DefaultGenerator.java:989)
at io.swagger.codegen.v3.DefaultGenerator.processPaths(DefaultGenerator.java:889)
at io.swagger.codegen.v3.DefaultGenerator.generateApis(DefaultGenerator.java:484)
at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:796)
at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:388)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Integer.toString()" because "i" is null
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.processPropertySchemaTypes(DefaultCodegenConfig.java:1666)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromProperty(DefaultCodegenConfig.java:1587)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromParameter(DefaultCodegenConfig.java:2530)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromOperation(DefaultCodegenConfig.java:2237)
at io.swagger.codegen.v3.DefaultGenerator.processOperation(DefaultGenerator.java:965)
... 5 more
When running the generator on a schema that contains a null enum option, we get an exception:
This occurs on enums like:
The suggested resolution is adding a null check in the problematic function:
DefaultCodegenConfig.java:processPropertySchemaTypes:1663