Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript client method signatures should mark metadata as optional #1368

Closed
andrewmbenton opened this issue Oct 5, 2023 · 0 comments · Fixed by #1369
Closed

TypeScript client method signatures should mark metadata as optional #1368

andrewmbenton opened this issue Oct 5, 2023 · 0 comments · Fixed by #1369

Comments

@andrewmbenton
Copy link
Contributor

andrewmbenton commented Oct 5, 2023

This is an inverse issue to #408

There are a couple of method signatures in the generated TypeScript client that should mark the metadata parameter as optional, to reduce explicitly passing unnecessary null values:

printer->Print(vars,
"request: $input_type$,\n"
"metadata: grpcWeb.Metadata | null): "
"$promise$<$output_type$>;\n\n");

printer->Print(vars,
"request: $input_type$,\n"
"metadata: grpcWeb.Metadata | null,\n"
"callback?: (err: grpcWeb.RpcError,\n"
" response: $output_type$) => void) {\n");

Making the metadata parameter optional in the method returning a Promise would bring the TypeScript client closer in line with the PromiseClient interface available when generating with import_style=commonjs+dts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants