This repository was archived by the owner on Mar 26, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,6 +167,16 @@ def tweak_path(p):
167167 "TRUE" ,
168168 )
169169
170+ # `rest-numeric-enums` is False by default. Make sure users can also disable
171+ # it by passing `rest-numeric-enums=False`.
172+ rest_numeric_enums = opts .pop ("rest-numeric-enums" , ["False" ])[0 ] in (
173+ "True" ,
174+ "true" ,
175+ "T" ,
176+ "t" ,
177+ "TRUE" ,
178+ )
179+
170180 # NOTE: Snippets are not currently correct for the alternative (Ads) templates
171181 # so always disable snippetgen in that case
172182 # https://github.com/googleapis/gapic-generator-python/issues/1052
@@ -197,7 +207,7 @@ def tweak_path(p):
197207 # transport should include desired transports delimited by '+', e.g. transport='grpc+rest'
198208 transport = opts .pop ("transport" , ["grpc" ])[0 ].split ("+" ),
199209 service_yaml_config = service_yaml_config ,
200- rest_numeric_enums = bool ( opts . pop ( "rest-numeric-enums" , False )) ,
210+ rest_numeric_enums = rest_numeric_enums ,
201211 proto_plus_deps = proto_plus_deps ,
202212 gapic_version = opts .pop ("gapic-version" , ["0.0.0" ]).pop (),
203213 )
Original file line number Diff line number Diff line change @@ -212,6 +212,9 @@ def test_options_bool_flags():
212212 options = Options .build ("autogen-snippets=False" )
213213 assert not options .autogen_snippets
214214
215+ options = Options .build ("rest-numeric-enums=False" )
216+ assert not options .rest_numeric_enums
217+
215218
216219def test_options_autogen_snippets_false_for_old_naming ():
217220 # NOTE: Snippets are not currently correct for the alternative (Ads) templates
You can’t perform that action at this time.
0 commit comments