Skip to content

fix: apply skip_serializing_none before Serialize derive on various structs - #61

Merged
George-Miao merged 2 commits into
George-Miao:masterfrom
lkurcak:fix-skip-serializing-none
Jul 31, 2026
Merged

fix: apply skip_serializing_none before Serialize derive on various structs#61
George-Miao merged 2 commits into
George-Miao:masterfrom
lkurcak:fix-skip-serializing-none

Conversation

@lkurcak

@lkurcak lkurcak commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #60

According to the docs, skip_serializing_none must be applied before the Serialize attribute to take effect. When it is placed after, None fields are serialized as null instead of being omitted.

Encountered this issue for Preferences (400 Bad Request) but there are multiple affected structs.

lkurcak added 2 commits July 29, 2026 18:18
…es\n\nThe attribute ordering matters: serde_with's skip_serializing_none must be\nplaced before #[derive(Serialize)] to take effect. Previously, None fields were\nserialized as null, causing qBittorrent to reject setPreferences requests with\n400 Bad Request.
The attribute ordering matters for serde_with: skip_serializing_none must be
placed before #[derive(Serialize)] to take effect. Previously, None fields in
GetTorrentListArg, AddTorrentArg, GetLogsArg, and several endpoint request
structs were serialized as null.

Add regression tests for the affected public model structs.

@George-Miao George-Miao left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@George-Miao
George-Miao merged commit 9a5434e into George-Miao:master Jul 31, 2026
5 checks passed
@lkurcak
lkurcak deleted the fix-skip-serializing-none branch July 31, 2026 12:59
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.

skip_serializing_none is placed after #[derive(Serialize)]

2 participants