This repository has been archived by the owner on Oct 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
generator-fix.patch
65 lines (62 loc) · 2.05 KB
/
generator-fix.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff --git a/.gitignore b/.gitignore
index a655050..d5f161c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
+
+.venv
+
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
diff --git a/gu_rest_api/__init__.py b/gu_rest_api/__init__.py
index 504f7f8..d0af253 100644
--- a/gu_rest_api/__init__.py
+++ b/gu_rest_api/__init__.py
@@ -19,6 +19,7 @@ __version__ = "1.0.0"
# import apis into sdk package
from gu_rest_api.api.peer_api import PeerApi
from gu_rest_api.api.session_api import SessionApi
+from gu_rest_api.driver import Driver
# import ApiClient
from gu_rest_api.api_client import ApiClient
diff --git a/gu_rest_api/api_client.py b/gu_rest_api/api_client.py
index 9c9bea4..e543fd6 100644
--- a/gu_rest_api/api_client.py
+++ b/gu_rest_api/api_client.py
@@ -17,6 +17,7 @@ from multiprocessing.pool import ThreadPool
import os
import re
import tempfile
+import gu_rest_api.none
# python 2 and python 3 compatibility library
import six
@@ -199,6 +200,8 @@ class ApiClient(object):
return None
elif isinstance(obj, self.PRIMITIVE_TYPES):
return obj
+ elif obj == gu_rest_api.none.NONE_IT:
+ return gu_rest_api.none.NONE_IT
elif isinstance(obj, list):
return [self.sanitize_for_serialization(sub_obj)
for sub_obj in obj]
diff --git a/gu_rest_api/rest.py b/gu_rest_api/rest.py
index b613b8a..6a88dea 100644
--- a/gu_rest_api/rest.py
+++ b/gu_rest_api/rest.py
@@ -14,6 +14,7 @@ from __future__ import absolute_import
import io
import json
+from gu_rest_api.none import dumps
import logging
import re
import ssl
@@ -157,7 +158,7 @@ class RESTClientObject(object):
if re.search('json', headers['Content-Type'], re.IGNORECASE):
request_body = None
if body is not None:
- request_body = json.dumps(body)
+ request_body = dumps(body)
r = self.pool_manager.request(
method, url,
body=request_body,