swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i ./openapi.yaml -l go -o ./swagger-client-go
Exception in thread "Thread-0" java.lang.RuntimeException: Could not process operation:
Tag: class Tag {
name: Networking
description: null
externalDocs: null
}
Operation: updateFirewallRules
Resource: put /networking/firewalls/{firewallId}/rules
Exception: Cannot invoke "io.swagger.v3.oas.models.media.Schema.getProperties()" because "fileTypeSchema" is null
at io.swagger.codegen.v3.DefaultGenerator.processOperation(DefaultGenerator.java:989)
at io.swagger.codegen.v3.DefaultGenerator.processPaths(DefaultGenerator.java:891)
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(Thread.java:840)
Caused by: java.lang.NullPointerException: Cannot invoke "io.swagger.v3.oas.models.media.Schema.getProperties()" because "fileTypeSchema" is null
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.isFileTypeSchema(DefaultCodegenConfig.java:4443)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromResponse(DefaultCodegenConfig.java:2349)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromOperation(DefaultCodegenConfig.java:2042)
at io.swagger.codegen.v3.generators.go.GoClientCodegen.fromOperation(GoClientCodegen.java:118)
at io.swagger.codegen.v3.DefaultGenerator.processOperation(DefaultGenerator.java:965)
... 5 more
Description
Not sure if it's my spec's issue but a null pointer exception was thrown.
Swagger-codegen version
Latest code in
3.0.0
branchSwagger declaration file content or url
Command line used for generation