Add passthrough for query parameters that the stack uses but that don't appear in discovery.
diff --git a/apiclient/discovery.py b/apiclient/discovery.py
index 7ae6a8a..db4dd47 100644
--- a/apiclient/discovery.py
+++ b/apiclient/discovery.py
@@ -44,6 +44,7 @@
DISCOVERY_URI = ('https://www.googleapis.com/discovery/v0.3/describe/'
'{api}/{apiVersion}')
DEFAULT_METHOD_DOC = 'A description of how to use this function'
+STACK_QUERY_PARAMETERS = ['trace']
def key2param(key):
@@ -259,7 +260,7 @@
def method(self, **kwargs):
for name in kwargs.iterkeys():
- if name not in argmap:
+ if name not in argmap and name not in STACK_QUERY_PARAMETERS:
raise TypeError('Got an unexpected keyword argument "%s"' % name)
for name in required_params:
diff --git a/tests/test_discovery.py b/tests/test_discovery.py
index adc5eb1..6a48d0e 100644
--- a/tests/test_discovery.py
+++ b/tests/test_discovery.py
@@ -103,6 +103,11 @@
request = zoo.query(q="foo", i="1", n="1", b="", a=[1,2,3], o={'a':1}, e='bar')
self._check_query_types(request)
+ def test_optional_stack_query_parameters(self):
+ self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
+ zoo = build('zoo', 'v1', self.http)
+ request = zoo.query(trace='html')
+
def test_buzz_resources(self):
self.http = HttpMock(datafile('buzz.json'), {'status': '200'})
buzz = build('buzz', 'v1', self.http)