Skip to content
This repository was archived by the owner on Jan 18, 2026. It is now read-only.

Commit 206dac3

Browse files
fix: add option to disable validator (#522)
* add option to disable validator * change the option * disable validation for docker test
1 parent c74d37f commit 206dac3

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

docker/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ mkdir $DIR_NAME
3232
docker run --rm \
3333
--mount type=bind,source=`pwd`/test-fixtures/protos/google/showcase/v1beta1,destination=/in/google/showcase/v1beta1,readonly \
3434
--mount type=bind,source=`pwd`/$DIR_NAME,destination=/out \
35+
--validation false
3536
gapic-generator-typescript:latest
3637
# Test generated client library
3738
cd $DIR_NAME

src/gapic-generator-typescript.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ const argv = yargs
4242
.alias('output-dir', 'output_dir')
4343
.describe('gapic-validator_out', 'Path to the output of the gapic validator')
4444
.alias('gapic-validator_out', 'gapic_validator_out')
45+
.describe(
46+
'validation',
47+
'Option to set the validation of proto files, default value is true'
48+
)
4549
.describe('output_dir', 'Path to a directory for the generated code')
4650
.alias('grpc-service-config', 'grpc_service_config')
4751
.describe('grpc-service-config', 'Path to gRPC service config JSON')
@@ -76,6 +80,7 @@ const packageName = argv.packageName as string | undefined;
7680
const mainServiceName = argv.mainService as string | undefined;
7781
const template = argv.template as string | undefined;
7882
const gapicValidatorOut = argv.gapicValidatorOut as string | undefined;
83+
const validation = argv.validation as string | 'true';
7984
const protoDirs: string[] = [];
8085
if (argv.I) {
8186
protoDirs.push(...(argv.I as string[]));
@@ -96,7 +101,7 @@ const protocCommand = [
96101
`--plugin=protoc-gen-typescript_gapic=${protocPlugin}`,
97102
`--typescript_gapic_out=${outputDir}`,
98103
];
99-
if (gapicValidatorOut) {
104+
if (gapicValidatorOut && validation !== 'true') {
100105
protocCommand.push(`--gapic-validator_out=${gapicValidatorOut}`);
101106
}
102107
if (grpcServiceConfig) {

0 commit comments

Comments
 (0)