File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -411,18 +411,12 @@ def document_api(
411
411
If this parameter is set, the `uri` parameter is ignored and the uri
412
412
will be created from this template.
413
413
"""
414
- # Use the discovery_uri_template to create the uri if provided,
415
- # ignoring the `uri` argument of `document_api`
416
- if discovery_uri_template :
417
- uri = uritemplate .expand (
418
- discovery_uri_template , {"api" : name , "apiVersion" : version }
419
- )
420
- else :
421
- # Use `uri` argument of `document_api` or
422
- # create the uri from `FLAGS.discovery_uri_template`
423
- uri = uri or uritemplate .expand (
424
- FLAGS .discovery_uri_template , {"api" : name , "apiVersion" : version }
425
- )
414
+ # The order for constructing `uri` is use `discovery_uri_template` if provided,
415
+ # then use `uri` argument if provided, then fallback to `FLAGS.discovery_uri_template`
416
+ uri = uritemplate .expand (
417
+ discovery_uri_template or uri or FLAGS .discovery_uri_template ,
418
+ {"api" : name , "apiVersion" : version },
419
+ )
426
420
427
421
http = build_http ()
428
422
resp , content = http .request (uri )
You can’t perform that action at this time.
0 commit comments