Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Duplicate message descriptors generated for request schemas whose names end with "Request" #93

@TylerGillson

Description

@TylerGillson

Steps to reproduce:

  1. Add the following to generator/testfiles/requestBodies.yaml:
/testRequestBodySchemaReference:
    post:
      operationId: testRequestBodySchemaReference
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestRequestBodySchemaReferenceRequest'
      responses:
        "201":
          description: OK
components:
  schemas:
    TestRequestBodySchemaReferenceRequest:
      type: object
      properties:
        person:
          $ref: '#/components/schemas/Person'
  1. Execute TestFileDescriptorGeneratorRequestBodies to generate an updated .proto file
  2. Observe the following duplication:
message TestRequestBodySchemaReferenceRequest {
  Person person = 1;
}

message Person {
  int64 id = 1;

  int64 age = 2;

  string name = 3;

  repeated string photo_urls = 4;
}

//TestRequestBodySchemaReferenceParameters holds parameters to TestRequestBodySchemaReference
message TestRequestBodySchemaReferenceRequest {
  TestRequestBodySchemaReferenceRequest test_request_body_schema_reference_request = 1;
}

service Requestbodies {
  rpc TestRequestBody ( TestRequestBodyRequest ) returns ( google.protobuf.Empty ) {
    option (google.api.http) = { get:"/testRequestBody" body:"person"  };
  }

  rpc TestRequestBodyReference ( TestRequestBodyReferenceRequest ) returns ( google.protobuf.Empty ) {
    option (google.api.http) = { get:"/testRequestBodyReference" body:"person"  };
  }

  rpc TestRequestBodySchemaReference ( TestRequestBodySchemaReferenceRequest ) returns ( google.protobuf.Empty ) {
    option (google.api.http) = { post:"/testRequestBodySchemaReference" body:"test_request_body_schema_reference_request"  };
  }
}

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