Skip to content

fix(http): preserve explicit null mutation values - #128

Merged
xibolun merged 2 commits into
rednote-infra:mainfrom
xibolun:issue/119
Nov 3, 2026
Merged

xibolun merged 2 commits into
rednote-infra:mainfrom
xibolun:issue/119

Conversation

@xibolun

@xibolun xibolun commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • serialize typed POST and PATCH models by field presence so omitted fields stay absent and explicitly supplied null values become JSON null
  • preserve false, zero, empty strings, empty collections, nested explicit nulls, and raw dictionary payloads
  • retain legacy manager behavior by omitting optional arguments that callers did not supply
  • centralize manager-owned optional argument filtering and document the Serial Interface revalidation step
  • add offline regression coverage for transport serialization and affected public manager APIs

User-facing Account behavior

Account models passed directly to add_account or update_account follow the same presence-aware rule as other typed models. Explicit construction such as Account(enabled=None) now sends Enabled as JSON null. In contrast, fields absent from Account.model_validate response data remain unset and are excluded from mutation payloads.

Validation

  • 872 passed, 11 skipped, 109 subtests passed (tests/test_real_bmc.py excluded as an integration test)
  • Ruff checks passed for changed source and tests
  • source compilation passed
  • source distribution and wheel builds passed

Closes #119

@xibolun
xibolun merged commit c552fb9 into rednote-infra:main Nov 3, 2026
5 checks passed
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.

fix(http): preserve explicitly supplied null values in mutation payloads

1 participant