From 95b74ac1dba71b983b42d61ea27f3f9efcb5b0bf Mon Sep 17 00:00:00 2001 From: Andrew Benton Date: Thu, 5 Oct 2023 09:11:00 -0700 Subject: [PATCH] feat(typescript): mark some `metadata` parameters as optional Resolves https://github.com/grpc/grpc-web/issues/1368 --- javascript/net/grpc/web/generator/grpc_generator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/net/grpc/web/generator/grpc_generator.cc b/javascript/net/grpc/web/generator/grpc_generator.cc index aaf0d3c0..3b10df78 100644 --- a/javascript/net/grpc/web/generator/grpc_generator.cc +++ b/javascript/net/grpc/web/generator/grpc_generator.cc @@ -653,7 +653,7 @@ void PrintTypescriptFile(Printer* printer, const FileDescriptor* file, printer->Indent(); printer->Print(vars, "request: $input_type$,\n" - "metadata: grpcWeb.Metadata | null): " + "metadata?: grpcWeb.Metadata | null): " "$promise$<$output_type$>;\n\n"); printer->Outdent(); @@ -671,7 +671,7 @@ void PrintTypescriptFile(Printer* printer, const FileDescriptor* file, printer->Indent(); printer->Print(vars, "request: $input_type$,\n" - "metadata: grpcWeb.Metadata | null,\n" + "metadata?: grpcWeb.Metadata | null,\n" "callback?: (err: grpcWeb.RpcError,\n" " response: $output_type$) => void) {\n"); printer->Print(vars, "if (callback !== undefined) {\n");