Skip to content

Commit

Permalink
fix(8-body-param-issue): update body param to handle simple False value
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sufyankhanrao committed Oct 7, 2022
1 parent 057de1b commit 62e7740
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apimatic_core/request_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 62e7740

Please sign in to comment.