Skip to content

Commit eee8b4b

Browse files
committed
switch from mutable bytearray to immutable bytes
1 parent 73dcdd6 commit eee8b4b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ public PythonClientCodegen() {
100100
typeMapping.put("set", "List");
101101
typeMapping.put("map", "Dict");
102102
typeMapping.put("decimal", "decimal.Decimal");
103-
typeMapping.put("file", "bytearray");
104-
typeMapping.put("binary", "bytearray");
105-
typeMapping.put("ByteArray", "bytearray");
103+
typeMapping.put("file", "bytes");
104+
typeMapping.put("binary", "bytes");
105+
typeMapping.put("ByteArray", "bytes");
106106

107107
languageSpecificPrimitives.remove("file");
108108
languageSpecificPrimitives.add("decimal.Decimal");
109-
languageSpecificPrimitives.add("bytearray");
109+
languageSpecificPrimitives.add("bytes");
110110
languageSpecificPrimitives.add("none_type");
111111

112112
supportsInheritance = true;

modules/openapi-generator/src/main/resources/python/api_client.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ class ApiClient:
313313
response_text = None
314314
return_data = None
315315
try:
316-
if response_type == "bytearray":
316+
if response_type in ("bytearray", "bytes"):
317317
return_data = response_data.data
318318
elif response_type == "file":
319319
return_data = self.__deserialize_file(response_data)

0 commit comments

Comments
 (0)