From 62e774035cc5bcf0f4d8f17c6be47922cf1dd7a1 Mon Sep 17 00:00:00 2001 From: Muhammad Sufyan Date: Fri, 7 Oct 2022 21:51:58 +0500 Subject: [PATCH] fix(8-body-param-issue): update body param to handle simple False value This commit bears a fix for the body param while serializing the request. There might be cases where request body parameter contain simple boolean value like False/True then the behavior of body serialization will fail therefore this change adds the not None check for the request body parameter. closes #8 --- apimatic_core/request_builder.py | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apimatic_core/request_builder.py b/apimatic_core/request_builder.py index 9c3a2b1..467ba84 100644 --- a/apimatic_core/request_builder.py +++ b/apimatic_core/request_builder.py @@ -182,11 +182,11 @@ def process_body_params(self): elif self._form_params or self._additional_form_params: self.add_additional_form_params() return ApiHelper.form_encode_parameters(self._form_params, self._array_serialization_format) - elif self._body_param and self._body_serializer: + elif self._body_param is not None and self._body_serializer: if self._should_wrap_body_param: return self._body_serializer(self.resolve_body_param(), self._should_wrap_body_param) return self._body_serializer(self.resolve_body_param()) - elif self._body_param and not self._body_serializer: + elif self._body_param is not None and not self._body_serializer: return self.resolve_body_param() def process_xml_parameters(self, body_serializer): diff --git a/setup.py b/setup.py index 26b5b83..7ab3cab 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( name='apimatic-core', - version='0.1.0', + version='0.1.1', description='A library that contains core logic and utilities for ' 'consuming REST APIs using Python SDKs generated by APIMatic.', long_description=long_description,