Skip to content

Commit 0a1b3c2

Browse files
Merge branch 'master' into master
2 parents 4a50fab + e5ef6cb commit 0a1b3c2

File tree

8 files changed

+14
-6
lines changed

8 files changed

+14
-6
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public AbstractGoCodegen() {
5151
"complex64",
5252
"complex128",
5353
"rune",
54+
"interface{}",
5455
"byte")
5556
);
5657

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
2525
public static final String PACKAGE_URL = "packageUrl";
2626
public static final String DEFAULT_LIBRARY = "urllib3";
2727

28+
public static final String WRITE_BINARY_OPTION = "writeBinary";
29+
2830
protected String packageName; // e.g. petstore_api
2931
protected String packageVersion;
3032
protected String projectName; // for setup.py, e.g. petstore-api
@@ -174,6 +176,11 @@ public void processOpts() {
174176
setPackageVersion("1.0.0");
175177
}
176178

179+
if (additionalProperties.containsKey(WRITE_BINARY_OPTION)) {
180+
boolean optionValue = Boolean.parseBoolean(String.valueOf(additionalProperties.get(WRITE_BINARY_OPTION)));
181+
additionalProperties.put(WRITE_BINARY_OPTION, optionValue);
182+
}
183+
177184
additionalProperties.put(CodegenConstants.PROJECT_NAME, projectName);
178185
additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
179186
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ class ApiClient(object):
540540
content_disposition).group(1)
541541
path = os.path.join(os.path.dirname(path), filename)
542542

543-
with open(path, "wb") as f:
543+
with open(path, {{^writeBinary}}"w"{{/writeBinary}}{{#writeBinary}}"wb"{{/writeBinary}}) as f:
544544
f.write(response.data)
545545

546546
return path
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.16-SNAPSHOT
1+
2.4.20-SNAPSHOT
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.19-SNAPSHOT
1+
2.4.20-SNAPSHOT

samples/client/petstore/go/go-petstore/docs/FakeApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ test inline additionalProperties
316316
Name | Type | Description | Notes
317317
------------- | ------------- | ------------- | -------------
318318
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
319-
**param** | [**interface{}**](interface{}.md)| request body |
319+
**param** | **interface{}**| request body |
320320

321321
### Return type
322322

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.19-SNAPSHOT
1+
2.4.20-SNAPSHOT

samples/client/petstore/python/petstore_api/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ def __deserialize_file(self, response):
534534
content_disposition).group(1)
535535
path = os.path.join(os.path.dirname(path), filename)
536536

537-
with open(path, "wb") as f:
537+
with open(path, "w") as f:
538538
f.write(response.data)
539539

540540
return path

0 commit comments

Comments
 (0)