AlexDaSoul/nestjs-proto-gen-ts

How to use message extends?

Closed this issue · 1 comments

example:

syntax = "proto3";
import "payment/payment-gateway.proto";

package paymentQiwi;

service GatewayQiwiService {
  rpc paymentCreate (PaymentCreateRequestDto)
    returns (PaymentCreateResponseDto);
}

message PaymentCreateRequestDto {
  extend paymentGateway.PaymentCreateRequestDto; // TODO: extend not working
}

output:

..
export namespace paymentQiwi {
    export interface GatewayQiwiService {
        paymentCreate(data: PaymentCreateRequestDto, metadata?: Metadata): Observable<PaymentCreateResponseDto>;
    }
    // tslint:disable-next-line:no-empty-interface
    export interface PaymentCreateRequestDto {
    }
    // tslint:disable-next-line:no-empty-interface
    export interface PaymentCreateResponseDto {
    }
}

export namespace paymentGateway {
...

so paymentQiwi.PaymentCreateRequestDto is empty, but I want to extend it from paymentGateway.PaymentCreateRequestDto

You can customize the template to your needs, use the recommendation from here #2