-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG][Golang][Client] composed-OneOf
become undefined
#1745
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
@zigen thanks for opening an issue. I wonder how Go GRPC client handles "oneOf" and potentially we can reuse similar code if the license permits so that we don't need to reinvent the wheel. |
hmm, it looks here? https://github.com/golang/protobuf/blob/master/protoc-gen-go/generator/generator.go#L2246 protoc and protoc-gen-go written in Go, so I think it's hard to reuse it in this project. I will try to investigate protoc-gen-go and implement in this year end. |
FYI
part of generated output with
protoc-gen-go generates with field tag |
any updates on this one? |
Description
composed-oneOf
generates undefined typeOneOfObjA
.here is generated code
this api should return one of
ObjA
orObjB
.but Golang doesn't have such feature to describe
TypeA | TypeB
.FYI https://developers.google.com/protocol-buffers/docs/reference/go-generated#oneof
openapi-generator version
4.0.0-SNAPSHOT 9e1cce2e7
OpenAPI declaration file content or url
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/composed-oneof.yaml
Command line used for generation
generate -t modules/openapi-generator/src/main/resources/go -i modules/openapi-generator/src/test/resources/3_0/composed-oneof.yaml -g go -o $GOPATH/src/github.com/zigen/go-sample-api -DpackageName=go_sample_api
https://github.com/zigen/openapi-generator-go-client-oas3-repro/blob/master/go-oneof.sh
Steps to reproduce
generate spec
modules/openapi-generator/src/test/resources/3_0/composed-oneof.yam
to golang and import it.this repo includes steps to repro, generated conde and example client.
https://github.com/zigen/openapi-generator-go-client-oas3-repro
Related issues/PRs
#1360
#500
Suggest a fix
The text was updated successfully, but these errors were encountered: