gibahjoe / openapi-generator-dart

Openapi Generator for Dart/Flutter
BSD 3-Clause "New" or "Revised" License
128 stars 34 forks source link

Generator dio fails with error - Null context for variable '.' #44

Closed vladaman closed 3 years ago

vladaman commented 3 years ago

Dio generator fails with following error. Generator.dart generates code properly.

[WARNING] openapi_generator:openapi_generator on lib/GenExample.dart:
Exception in thread "main" java.lang.RuntimeException: Could not generate model 'CardWidget'
        at org.openapitools.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:544)
        at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:875)
        at org.openapitools.codegen.cmd.Generate.execute(Generate.java:440)
        at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
Caused by: java.lang.NullPointerException: Null context for variable '.' on line 29
        at com.samskivert.mustache.Template.getValueIn(Template.java:288)
        at com.samskivert.mustache.Template.getValue(Template.java:224)
        at com.samskivert.mustache.Template.getValueOrDefault(Template.java:279)
        at com.samskivert.mustache.Mustache$VariableSegment.execute(Mustache.java:802)
        at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:845)
        at com.samskivert.mustache.Mustache$SectionSegment.execute(Mustache.java:866)
        at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:845)
        at com.samskivert.mustache.Mustache$InvertedSegment.execute(Mustache.java:906)
        at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:845)
        at com.samskivert.mustache.Mustache$SectionSegment.execute(Mustache.java:881)
        at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:845)
        at com.samskivert.mustache.Mustache$SectionSegment.execute(Mustache.java:866)
        at com.samskivert.mustache.Template.executeSegs(Template.java:157)
        at com.samskivert.mustache.Mustache$IncludedTemplateSegment.execute(Mustache.java:774)
        at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:845)
        at com.samskivert.mustache.Mustache$InvertedSegment.execute(Mustache.java:910)
        at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:845)
        at com.samskivert.mustache.Mustache$SectionSegment.execute(Mustache.java:881)
        at com.samskivert.mustache.Mustache$BlockSegment.executeSegs(Mustache.java:845)
        at com.samskivert.mustache.Mustache$SectionSegment.execute(Mustache.java:866)
        at com.samskivert.mustache.Template.executeSegs(Template.java:157)
        at com.samskivert.mustache.Template.execute(Template.java:134)
        at com.samskivert.mustache.Template.execute(Template.java:125)
        at org.openapitools.codegen.templating.MustacheEngineAdapter.compileTemplate(MustacheEngineAdapter.java:65)
        at org.openapitools.codegen.TemplateManager.write(TemplateManager.java:163)
        at org.openapitools.codegen.DefaultGenerator.processTemplateToFile(DefaultGenerator.java:1017)
        at org.openapitools.codegen.DefaultGenerator.generateModel(DefaultGenerator.java:382)
        at org.openapitools.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:535)
        ... 4 more
gibahjoe commented 3 years ago

Hello, if this is not too late, please provide the spec to recreate the issue and the generator version

gibahjoe commented 3 years ago

Closing this as there are no clear next steps. Feel free to open up