Skip to content

fix: omit unset enableUspsCass from Address Validation requests - #7

Draft
illuminati1911 wants to merge 1 commit into
masterfrom
omit-unset-usps-cass
Draft

illuminati1911 wants to merge 1 commit into
masterfrom
omit-unset-usps-cass

Conversation

@illuminati1911

Copy link
Copy Markdown
Collaborator

Summary

  • Include enableUspsCass in the JSON request only when its value is not None.
  • Preserve explicitly supplied True and False values.
  • Replace the URL-only test with serialized-request regression coverage and add a changelog entry.

The existing condition is always true, including for the default None value, so an omitted option is sent as JSON null: https://github.com/googlemaps/google-maps-services-python/blob/d3b71ab1333cff0f900d2db6b39c1356341a5ea2/googlemaps/addressvalidation.py#L47-L75

This corrects unintended serialization; it does not claim that the API rejects null. The existing documentation and response handling are otherwise unchanged.

Verification

  • Python 3.10: python -m pytest tests/test_addressvalidation.py — 1 passed, covering omitted, true, and false serialization cases.
  • Python 3.10: python -m pytest — 105 passed.
  • Reproduced the original null serialization before the fix and confirmed the correction afterward with locally intercepted requests and live sockets blocked.
  • Also exercised the committed fix over real loopback HTTP for omitted, explicit None, True, and False inputs. Confirmed successful results and preservation of other address fields. No Google Maps requests or real credentials were used.
  • nox --download-python never -s docs --force-python 3.10 — passed. Visually inspected generated Sphinx documentation and the rendered changelog in Chromium.
  • The prescribed Python 3.7 docs build remains unverified because Python 3.7 is unavailable on this machine. The Python 3.10 build is supplemental.
  • Pytest ran directly with the repository's test dependencies to avoid the Nox follow-on Codecov upload.

@illuminati1911 illuminati1911 self-assigned this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant