google / google/gnostic

getting issue when generating the OAS V3 from protofile

Open
#246 4 comments 1 reaction 1 assignee Claimed by @timburks View on GitHub
Dominant language
Go
Stars
2.3k
Forks
279
PR merge metrics
No merged PRs in 30d

Description

Command:
tried this => protoc -I proto/ sample.proto -I. --openapi_out=.
tried this => protoc sample.proto -I. --openapi_out=.

Version: gnostic@v0.5.5

Error:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x14c8759]

goroutine 1 [running]:
github.com/googleapis/gnostic/apps/protoc-gen-openapi/generator.(*OpenAPIv3Generator).addPathsToDocumentV3(0xc0002a0e60, 0xc000143680, 0xc0002f1900)
github.com/googleapis/gnostic@v0.5.5/apps/protoc-gen-openapi/generator/openapi-v3.go:136 +0x1d9
github.com/googleapis/gnostic/apps/protoc-gen-openapi/generator.(*OpenAPIv3Generator).buildDocumentV3(0xc0002a0e60, 0x1)
github.com/googleapis/gnostic@v0.5.5/apps/protoc-gen-openapi/generator/openapi-v3.go:83 +0x178
github.com/googleapis/gnostic/apps/protoc-gen-openapi/generator.(*OpenAPIv3Generator).Run(0xc0002a0e60, 0xc0002a0e60, 0x0)
github.com/googleapis/gnostic@v0.5.5/apps/protoc-gen-openapi/generator/openapi-v3.go:57 +0x2f
main.main.func1(0xc000268e60, 0x0, 0xc0001780e0)
github.com/googleapis/gnostic@v0.5.5/apps/protoc-gen-openapi/main.go:25 +0x39
google.golang.org/protobuf/compiler/protogen.run(0x0, 0x0, 0x15e5d80, 0x1a95900, 0x0)
google.golang.org/protobuf@v1.26.0/compiler/protogen/protogen.go:74 +0x1e2
google.golang.org/protobuf/compiler/protogen.Options.Run(0x0, 0x0, 0x15e5d80)
google.golang.org/protobuf@v1.26.0/compiler/protogen/protogen.go:52 +0x5a
main.main()
github.com/googleapis/gnostic@v0.5.5/apps/protoc-gen-openapi/main.go:24 +0x35
--openapi_out: protoc-gen-openapi: Plugin failed with status code 2.

Please resolve this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.