From 109190ae7291944cce119cab38e4e3c811cfa726 Mon Sep 17 00:00:00 2001 From: Marco <80593920+Marco2929@users.noreply.github.com> Date: Thu, 9 Mar 2023 11:36:28 +0100 Subject: [PATCH] Update rest.mustache Better upload compatibility with file types --- .../swagger-codegen/src/main/resources/python/rest.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/python/rest.mustache b/modules/swagger-codegen/src/main/resources/python/rest.mustache index 6c5dd3f2b69..b0076e9d5e1 100644 --- a/modules/swagger-codegen/src/main/resources/python/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/rest.mustache @@ -176,10 +176,10 @@ class RESTClientObject(object): preload_content=_preload_content, timeout=timeout, headers=headers) - # Pass a `string` parameter directly in the body to support + # Pass a `string` or a `bytes` parameter directly in the body to support # other content types than Json when `body` argument is # provided in serialized form - elif isinstance(body, str): + elif isinstance(body, str) or isinstance(body, bytes): request_body = body r = self.pool_manager.request( method, url,