Skip to content

Commit 7a35f8c

Browse files
committed
address review feedback
1 parent 3863180 commit 7a35f8c

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

describe.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -411,18 +411,12 @@ 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,
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+
)
426420

427421
http = build_http()
428422
resp, content = http.request(uri)

0 commit comments

Comments
 (0)