Skip to content

unused message don't gen swagger ? #435

@dobet

Description

@dobet

I have 2 message used to an Any field

message AnyItem {
  option (openapi.v3.schema) = {
    title: "AnyItem";
    required: "true";
  };
  map<string, string> data = 1;
}

message AnyItem2 {
  option (openapi.v3.schema) = {
    title: "AnyItem2";
    required: "true"
  };
  repeated string data = 1;
}

// The response message containing the greetings
message HelloReply {
  string name = 1;
  repeated google.protobuf.Any data = 2 [
    (openapi.v3.property) = {
      required: [
        "AnyItem", "AnyItem2"
      ]
      items: {
        schema_or_reference: [
          {
            reference: {
              _ref: "#/components/schemas/AnyItem"
            }
          },
          {
            reference: {
              _ref: "#/components/schemas/AnyItem2"
            }
          }
        ]
      }
    }
  ];
}

but I got an openapi.yaml that don't have AnyItem and AnyItem2, and protobuf.Any don't convert

        helloworld.v1.HelloReply:
            type: object
            properties:
                name:
                    type: string
                data:
                    required:
                        - AnyItem
                        - AnyItem2
                    type: array
                    items:
                        - $ref: '#/components/schemas/google.protobuf.Any'
                        - $ref: '#/components/schemas/AnyItem'
                        - $ref: '#/components/schemas/AnyItem2

what can I do , the helloReply can ref AnyItem and AnyItem2?

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