You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Generation code from a yaml spec (see example yaml) fails when using generator 6.0.0 instead of 5.4.0 with this output:
Exception: Cannot read field "dataType" because "p.items" is null
at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:1167)
at org.openapitools.codegen.DefaultGenerator.processPaths(DefaultGenerator.java:1058)
at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:553)
at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:895)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:449)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
Caused by: java.lang.NullPointerException: Cannot read field "dataType" because "p.items" is null
at org.openapitools.codegen.languages.AbstractCSharpCodegen.setParameterExampleValue(AbstractCSharpCodegen.java:1414)
at org.openapitools.codegen.DefaultCodegen.setParameterExampleValue(DefaultCodegen.java:1901)
at org.openapitools.codegen.DefaultCodegen.finishUpdatingParameter(DefaultCodegen.java:4528)
at org.openapitools.codegen.DefaultCodegen.fromParameter(DefaultCodegen.java:4847)
at org.openapitools.codegen.DefaultCodegen.fromOperation(DefaultCodegen.java:4162)
at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:1135)
Bug Report Checklist
Description
Generation code from a yaml spec (see example yaml) fails when using generator 6.0.0 instead of 5.4.0 with this output:
Exception: Cannot read field "dataType" because "p.items" is null
at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:1167)
at org.openapitools.codegen.DefaultGenerator.processPaths(DefaultGenerator.java:1058)
at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:553)
at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:895)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:449)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
Caused by: java.lang.NullPointerException: Cannot read field "dataType" because "p.items" is null
at org.openapitools.codegen.languages.AbstractCSharpCodegen.setParameterExampleValue(AbstractCSharpCodegen.java:1414)
at org.openapitools.codegen.DefaultCodegen.setParameterExampleValue(DefaultCodegen.java:1901)
at org.openapitools.codegen.DefaultCodegen.finishUpdatingParameter(DefaultCodegen.java:4528)
at org.openapitools.codegen.DefaultCodegen.fromParameter(DefaultCodegen.java:4847)
at org.openapitools.codegen.DefaultCodegen.fromOperation(DefaultCodegen.java:4162)
at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:1135)
openapi-generator version
Works with 5.4.0
Fails with 6.0.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Take the yaml spec and try to generate, 5.4.0 will succeed, 6.0.0 will fail with an exception
java -jar "..\generator\openapi-generator-cli-5.4.0.jar" generate -g aspnetcore -i ...\api\api.yml -o ..\api\generated\aspnetcore
java -jar "..\generator\openapi-generator-cli-6.0.0.jar" generate -g aspnetcore -i ...\api\api.yml -o ..\api\generated\aspnetcore
Related issues/PRs
Suggest a fix
#11355 might have introduces the bug,
The text was updated successfully, but these errors were encountered: