Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip sending optional parameters on POST request when unspecified #230

Merged
merged 2 commits into from
Jul 8, 2020

Conversation

lbalmaceda
Copy link
Contributor

Changes

The python request library when it creates the query parameters, it will remove any parameter on the passed dict that has a value of None. In our library, these are only used for GET requests.
For the case of POST or PATCH requests, the dict that conforms the body will not suffer the same filtering.

In some cases it makes sense to send an explicit null value, like when removing a property from the user's user_metadata property, the check should be performed on each POST/PATCH function instead of in the base client class.

The PR also includes some linting fixes, related to doc blocks and formatting.

References

Fixes #228

Docs on the params filtering https://requests.readthedocs.io/en/master/user/quickstart/#passing-parameters-in-urls. Note it doesn't explicitly mention how the body params are being handled.

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • This change adds unit test coverage
  • This change adds integration test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@lbalmaceda lbalmaceda added CH: Fixed small Small review labels Jul 7, 2020
@lbalmaceda lbalmaceda added this to the v3-Next milestone Jul 7, 2020
@lbalmaceda lbalmaceda requested a review from a team July 7, 2020 19:36
@lbalmaceda lbalmaceda force-pushed the fix-body-none branch 2 times, most recently from b49cba2 to 50ed926 Compare July 8, 2020 17:20
@lbalmaceda lbalmaceda merged commit 967168d into master Jul 8, 2020
@lbalmaceda lbalmaceda deleted the fix-body-none branch July 8, 2020 17:27
@lbalmaceda lbalmaceda modified the milestones: v3-Next, 3.12.0 Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Fixed small Small review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Database Signup requires username even when optional
2 participants