diff options
author | Anthonios Partheniou <partheniou@google.com> | 2021-01-14 18:48:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-14 18:48:59 -0500 |
commit | 32d1c597b364e2641eca33ccf6df802bb218eea1 (patch) | |
tree | 59e4c79545fe36ab34c66c74be6374732ef3b033 /describe.py | |
parent | b7b9986fe13c483eeefb77673b4091911978ee46 (diff) | |
download | google-api-python-client-32d1c597b364e2641eca33ccf6df802bb218eea1.tar.gz |
feat: Add support for using static discovery documents (#1109)
* feat: Add support for static discovery documents
* Auto generated docs should use static artifacts
Diffstat (limited to 'describe.py')
-rwxr-xr-x | describe.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/describe.py b/describe.py index 3d9d7a46a..e53724e04 100755 --- a/describe.py +++ b/describe.py @@ -37,6 +37,7 @@ from googleapiclient.discovery import DISCOVERY_URI from googleapiclient.discovery import build from googleapiclient.discovery import build_from_document from googleapiclient.discovery import UnknownApiNameOrVersion +from googleapiclient.discovery_cache import get_static_doc from googleapiclient.http import build_http from googleapiclient.errors import HttpError @@ -395,6 +396,7 @@ def document_api(name, version, uri): """ try: service = build(name, version) + content = get_static_doc(name, version) except UnknownApiNameOrVersion as e: print("Warning: {} {} found but could not be built.".format(name, version)) return @@ -402,12 +404,6 @@ def document_api(name, version, uri): print("Warning: {} {} returned {}.".format(name, version, e)) return - http = build_http() - response, content = http.request( - uri or uritemplate.expand( - FLAGS.discovery_uri_template, {"api": name, "apiVersion": version} - ) - ) discovery = json.loads(content) version = safe_version(version) |