File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,16 @@ def tweak_path(p):
167
167
"TRUE" ,
168
168
)
169
169
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
+
170
180
# NOTE: Snippets are not currently correct for the alternative (Ads) templates
171
181
# so always disable snippetgen in that case
172
182
# https://github.com/googleapis/gapic-generator-python/issues/1052
@@ -197,7 +207,7 @@ def tweak_path(p):
197
207
# transport should include desired transports delimited by '+', e.g. transport='grpc+rest'
198
208
transport = opts .pop ("transport" , ["grpc" ])[0 ].split ("+" ),
199
209
service_yaml_config = service_yaml_config ,
200
- rest_numeric_enums = bool ( opts . pop ( "rest-numeric-enums" , False )) ,
210
+ rest_numeric_enums = rest_numeric_enums ,
201
211
proto_plus_deps = proto_plus_deps ,
202
212
gapic_version = opts .pop ("gapic-version" , ["0.0.0" ]).pop (),
203
213
)
Original file line number Diff line number Diff line change @@ -212,6 +212,9 @@ def test_options_bool_flags():
212
212
options = Options .build ("autogen-snippets=False" )
213
213
assert not options .autogen_snippets
214
214
215
+ options = Options .build ("rest-numeric-enums=False" )
216
+ assert not options .rest_numeric_enums
217
+
215
218
216
219
def test_options_autogen_snippets_false_for_old_naming ():
217
220
# NOTE: Snippets are not currently correct for the alternative (Ads) templates
You can’t perform that action at this time.
0 commit comments