swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
I use simple YAML (JSON tested too) and have a problem with clients generation.
The error:
[main] INFO io.swagger.parser.Swagger20Parser - reading from ./swaggers/build.yaml
[main] INFO io.swagger.codegen.languages.CSharpClientCodegen - Generating code for .NET Framework v4.5
Exception in thread "main" java.lang.RuntimeException: Could not process model 'BranchConfiguration'.Please make sure that your schema is correct!
at io.swagger.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:328)
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:697)
at io.swagger.codegen.cmd.Generate.run(Generate.java:285)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: java.lang.NullPointerException
at io.swagger.codegen.DefaultCodegen.fromModel(DefaultCodegen.java:1284)
at io.swagger.codegen.languages.CSharpClientCodegen.fromModel(CSharpClientCodegen.java:430)
at io.swagger.codegen.DefaultCodegen.fromModel(DefaultCodegen.java:1266)
at io.swagger.codegen.languages.CSharpClientCodegen.fromModel(CSharpClientCodegen.java:433)
at io.swagger.codegen.DefaultGenerator.processModels(DefaultGenerator.java:939)
at io.swagger.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:323)
... 3 more
Description
I use simple YAML (JSON tested too) and have a problem with clients generation.
The error:
Swagger-codegen version
Latest, 2.2.3 version
Swagger declaration file
Command line used for generation
swagger-codegen generate -i ./swagger.yaml -l csharp -o ./clients/swagger-codegen-csharp