Skip to content
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

protoc-gen-openapi: there are something wrong with the generated openapi.yaml when message's name is same #353

Closed
yzhaoyu opened this issue Apr 29, 2022 · 2 comments

Comments

@yzhaoyu
Copy link

yzhaoyu commented Apr 29, 2022

I found that when I referred to proto A file there is A messge named View, and the proto that was referred to also referred to another proto B, B proto file also has a message named View, The generated View in openapi.yaml was not the view in proto A, it was replaced by the view in proto B.
proto A like this:

service Open {
  rpc GetView (View) returns (Response);
}

message View {
    string id = 1;
}

message File {
 protoB.Binary = 1;
}

proto B like this:

message View {
    string test = 1;
}

message Binary {
    int32 stream = 1;
}

The generated openapi.yaml contains View of proto B, not View of proto A.
Is this a bug?

@yzhaoyu yzhaoyu changed the title protoc-gen-openapi: there are some wrong with the generated openapi.yaml when message's name is same protoc-gen-openapi: there are something wrong with the generated openapi.yaml when message's name is same Apr 29, 2022
@timburks
Copy link
Contributor

Thanks, this is certainly a possibility. Could you try using the fq_schema_naming option that @jeffsawatzky added? Do the results of that work for you?

@yzhaoyu
Copy link
Author

yzhaoyu commented May 5, 2022

Thanks, this is certainly a possibility. Could you try using the fq_schema_naming option that @jeffsawatzky added? Do the results of that work for you?

Thank you very much. This is very useful for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants