diff --git a/src/main/resources/python/swagger.mustache b/src/main/resources/python/swagger.mustache index 7ea42914a86..5a6b6d981fd 100644 --- a/src/main/resources/python/swagger.mustache +++ b/src/main/resources/python/swagger.mustache @@ -44,17 +44,15 @@ class ApiClient: data = None - if method == 'GET': + if queryParams: + # Need to remove None values, these should not be sent + sentQueryParams = {} + for param, value in queryParams.items(): + if value != None: + sentQueryParams[param] = value + url = url + '?' + urllib.urlencode(sentQueryParams) - if queryParams: - # Need to remove None values, these should not be sent - sentQueryParams = {} - for param, value in queryParams.items(): - if value != None: - sentQueryParams[param] = value - url = url + '?' + urllib.urlencode(sentQueryParams) - - elif method in ['POST', 'PUT', 'DELETE']: + if method in ['POST', 'PUT', 'DELETE']: if postData: headers['Content-type'] = 'application/json' diff --git a/src/main/resources/python3/swagger.mustache b/src/main/resources/python3/swagger.mustache index 7000827e0ba..808599f5bda 100644 --- a/src/main/resources/python3/swagger.mustache +++ b/src/main/resources/python3/swagger.mustache @@ -43,17 +43,16 @@ class ApiClient: data = None - if method == 'GET': + + if queryParams: + # Need to remove None values, these should not be sent + sentQueryParams = {} + for param, value in queryParams.items(): + if value != None: + sentQueryParams[param] = value + url = url + '?' + urllib.parse.urlencode(sentQueryParams) - if queryParams: - # Need to remove None values, these should not be sent - sentQueryParams = {} - for param, value in queryParams.items(): - if value != None: - sentQueryParams[param] = value - url = url + '?' + urllib.parse.urlencode(sentQueryParams) - - elif method in ['POST', 'PUT', 'DELETE']: + if method in ['POST', 'PUT', 'DELETE']: if postData: headers['Content-type'] = 'application/json'