Skip to content

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

Closed

Description

@yzhaoyu

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?

Activity

  1. 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[/+] on Apr 29, 2022
  2. timburks commented on Apr 29, 2022

    @timburks
    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?

  3. yzhaoyu commented on May 5, 2022

    @yzhaoyu
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions