Skip to content

Commit 676da33

Browse files
committed
true portable binary type
1 parent d2b9107 commit 676da33

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public PythonClientCodegen() {
7272
languageSpecificPrimitives.add("datetime");
7373
languageSpecificPrimitives.add("date");
7474
languageSpecificPrimitives.add("object");
75+
languageSpecificPrimitives.add("binary_type");
7576

7677
typeMapping.clear();
7778
typeMapping.put("integer", "int");
@@ -89,8 +90,8 @@ public PythonClientCodegen() {
8990
typeMapping.put("file", "file");
9091
// TODO binary should be mapped to byte array
9192
// mapped to String as a workaround
92-
typeMapping.put("binary", "str");
93-
typeMapping.put("ByteArray", "str");
93+
typeMapping.put("binary", "binary_type");
94+
typeMapping.put("ByteArray", "binary_type");
9495
// map uuid to string for the time being
9596
typeMapping.put("UUID", "str");
9697

modules/swagger-codegen/src/main/resources/python/api_client.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ from multiprocessing.pool import ThreadPool
1515
from datetime import date, datetime
1616

1717
# python 2 and python 3 compatibility library
18-
from six import PY3, integer_types, iteritems, text_type
18+
from six import PY3, integer_types, iteritems, text_type, binary_type
1919
from six.moves.urllib.parse import quote
2020

2121
from . import models
@@ -51,6 +51,7 @@ class ApiClient(object):
5151
'date': date,
5252
'datetime': datetime,
5353
'object': object,
54+
'binary_type': binary_type,
5455
}
5556

5657
def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None):

0 commit comments

Comments
 (0)