Skip to content

Commit 1502642

Browse files
Merge branch 'migrate-to-discovery-artifact-manager' of https://github.com/googleapis/google-api-python-client into migrate-to-discovery-artifact-manager
2 parents 355963b + 690dd61 commit 1502642

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

describe.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,16 +411,18 @@ def document_api(
411411
If this parameter is set, the `uri` parameter is ignored and the uri
412412
will be created from this template.
413413
"""
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`
415416
if discovery_uri_template:
416417
uri = uritemplate.expand(
417418
discovery_uri_template, {"api": name, "apiVersion": version}
418419
)
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+
)
424426

425427
http = build_http()
426428
resp, content = http.request(uri)

0 commit comments

Comments
 (0)