From a0e7b40d77be114d5e6a94d5a7b23b780b7e8231 Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Fri, 20 Mar 2020 15:59:31 -0700 Subject: [PATCH] fix: render subresponse_field as string if it is not null (#346) * add quote to subresponse_field * feedback --- .../logging/src/v2/logging_service_v2_client.ts.baseline | 3 ++- .../typescript_gapic/src/$version/$service_client.ts.njk | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/baselines/logging/src/v2/logging_service_v2_client.ts.baseline b/baselines/logging/src/v2/logging_service_v2_client.ts.baseline index 5ba88cbd3..cc44146d2 100644 --- a/baselines/logging/src/v2/logging_service_v2_client.ts.baseline +++ b/baselines/logging/src/v2/logging_service_v2_client.ts.baseline @@ -230,7 +230,8 @@ export class LoggingServiceV2Client { this._descriptors.batching = { WriteLogEntries: new this._gaxModule.BundleDescriptor( 'entries', - ['log_name','resource','labels'],null, + ['log_name','resource','labels'], + null, gax.createByteLengthFunction( // tslint:disable-next-line no-any protoFilesRoot.lookupType('google.logging.v2.LogEntry') as any diff --git a/templates/typescript_gapic/src/$version/$service_client.ts.njk b/templates/typescript_gapic/src/$version/$service_client.ts.njk index ac98763f0..8644039bf 100644 --- a/templates/typescript_gapic/src/$version/$service_client.ts.njk +++ b/templates/typescript_gapic/src/$version/$service_client.ts.njk @@ -234,7 +234,11 @@ export class {{ service.name }}Client { '{{ field }}' {%- endfor -%} ], - {{- method.bundleConfig.batchDescriptor.subresponse_field }}, +{%- if method.bundleConfig.batchDescriptor.subresponse_field === 'null' %} + null, +{%- else %} + '{{- method.bundleConfig.batchDescriptor.subresponse_field }}', +{%- endif %} gax.createByteLengthFunction( // tslint:disable-next-line no-any protoFilesRoot.lookupType('{{ method.bundleConfig.repeatedField }}') as any