Skip to content

Commit

Permalink
fix: python parameters_to_url_query template to properly detect booleans
Browse files Browse the repository at this point in the history
  • Loading branch information
mhaley-tignis committed Oct 31, 2023
1 parent 6f55762 commit 5daf5ab
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,10 @@ class ApiClient:
if collection_formats is None:
collection_formats = {}
for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, bool):
v = str(v).lower()
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, dict):
v = json.dumps(v)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,10 @@ class ApiClient:
if collection_formats is None:
collection_formats = {}
for k, v in params.items() if isinstance(params, dict) else params:
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, bool):
v = str(v).lower()
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, dict):
v = json.dumps(v)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,10 @@ def parameters_to_url_query(self, params, collection_formats):
if collection_formats is None:
collection_formats = {}
for k, v in params.items() if isinstance(params, dict) else params:
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, bool):
v = str(v).lower()
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, dict):
v = json.dumps(v)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,10 @@ def parameters_to_url_query(self, params, collection_formats):
if collection_formats is None:
collection_formats = {}
for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, bool):
v = str(v).lower()
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, dict):
v = json.dumps(v)

Expand Down
4 changes: 2 additions & 2 deletions samples/client/echo_api/python/openapi_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,10 @@ def parameters_to_url_query(self, params, collection_formats):
if collection_formats is None:
collection_formats = {}
for k, v in params.items() if isinstance(params, dict) else params:
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, bool):
v = str(v).lower()
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, dict):
v = json.dumps(v)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,10 @@ def parameters_to_url_query(self, params, collection_formats):
if collection_formats is None:
collection_formats = {}
for k, v in params.items() if isinstance(params, dict) else params:
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, bool):
v = str(v).lower()
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, dict):
v = json.dumps(v)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,10 @@ def parameters_to_url_query(self, params, collection_formats):
if collection_formats is None:
collection_formats = {}
for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, bool):
v = str(v).lower()
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, dict):
v = json.dumps(v)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,10 @@ def parameters_to_url_query(self, params, collection_formats):
if collection_formats is None:
collection_formats = {}
for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, bool):
v = str(v).lower()
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, dict):
v = json.dumps(v)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,10 @@ def parameters_to_url_query(self, params, collection_formats):
if collection_formats is None:
collection_formats = {}
for k, v in params.items() if isinstance(params, dict) else params:
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, bool):
v = str(v).lower()
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, dict):
v = json.dumps(v)

Expand Down

0 comments on commit 5daf5ab

Please sign in to comment.