Skip to content

response_or_reference ref is not generated correctly #437

@kotyara85

Description

@kotyara85

Hey there,
So I have this in my proto file:

            responses: {
              response_or_reference: {
                name: "default"
                value: {
                  response: {
                    content: {
                      additional_properties: [{
                        value: {
                          schema: {
                            reference: { _ref: "#/components/schemas/ErrorResponse"; }
                          }
                        }
                      }]
                    }
                  }
                }
              }
            }

and

message ErrorResponse {
  string message = 1 [(google.api.field_behavior) = REQUIRED];
}

ErrorResponse is being generated into go code, but when I run protoc with openapi ErrorResponse is not being added to components (it's not being used anywhere besides the code above)
Is there any way to force openapi generator to add all structs into the components?

Thanks!

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