File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -411,16 +411,18 @@ 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
414
+ # Use the discovery_uri_template to create the uri if provided,
415
+ # ignoring the `uri` argument of `document_api`
415
416
if discovery_uri_template :
416
417
uri = uritemplate .expand (
417
418
discovery_uri_template , {"api" : name , "apiVersion" : version }
418
419
)
419
-
420
- if not uri :
421
- uri = uritemplate .expand (
422
- FLAGS .discovery_uri_template , {"api" : name , "apiVersion" : version }
423
- )
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
+ )
424
426
425
427
http = build_http ()
426
428
resp , content = http .request (uri )
You can’t perform that action at this time.
0 commit comments