improbable-eng / ts-protoc-gen

Protocol Buffers Compiler (protoc) plugin for TypeScript and gRPC-Web.
Apache License 2.0
1.36k stars 173 forks source link

Typing for repeated extension fields generated incorrectly #313

Closed stasberkov closed 7 months ago

stasberkov commented 8 months ago

Versions of relevant software used ts-protoc-gen@0.15.0

What happened

I have protocol with repeated extension field i.e.

extend WebAPI_2.ClientMsg
{
  repeated RFQSubscriptionRequest rfq_subscription_requests = 206;
}

ts-protoc-gen generates typing for it as

  export const rfqSubscriptionRequests: jspb.ExtensionFieldInfo<RFQSubscriptionRequest>;

What you expected to happen

Typing should be

  export const rfqSubscriptionRequestsList: jspb.ExtensionFieldInfo<Array<RFQSubscriptionRequest>>;

Changes: 1) add "List" suffix, 2) add Array for type.