Skip to content

build(deps): replace serde_html_form with serde_urlencoded#1146

Merged
0x676e67 merged 2 commits intomainfrom
form
Apr 16, 2026
Merged

build(deps): replace serde_html_form with serde_urlencoded#1146
0x676e67 merged 2 commits intomainfrom
form

Conversation

@0x676e67
Copy link
Copy Markdown
Owner

@0x676e67 0x676e67 commented Apr 16, 2026

close: #1135

Summary by CodeRabbit

  • Chores
    • Updated serialization library dependencies used for form and query string handling to enhance compatibility and stability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 16, 2026

📝 Walkthrough

Walkthrough

This pull request replaces the deprecated serde_urlencoded dependency with serde_html_form across the codebase. The change updates feature flag definitions in Cargo.toml and modifies serialization calls in the request builder to use the new library while preserving existing functionality.

Changes

Cohort / File(s) Summary
Dependency Migration
Cargo.toml
Replaced serde_urlencoded (0.7.1) with serde_html_form (0.4.0) as optional dependency; updated query and form feature flags to depend on serde_html_form.
Serialization Updates
src/client/request.rs
Changed RequestBuilder::query() and RequestBuilder::form() methods to use serde_html_form::to_string() instead of serde_urlencoded::to_string() for serialization.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A library well-worn, now passes the torch,
From serde_urlencoded to paths more scorched,
With serde_html_form our queries now sing,
Better maintained, a fresher spring! 🌱

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title states 'replace serde_html_form with serde_urlencoded' but the actual changes replace serde_urlencoded with serde_html_form, which is the opposite of what the title claims. Update the title to correctly reflect the changes: 'build(deps): replace serde_urlencoded with serde_html_form'
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The code changes successfully implement the migration requested in issue #1135: replacing serde_urlencoded with serde_html_form in both Cargo.toml dependencies and the actual serialization calls in request.rs.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue objective of migrating from serde_urlencoded to serde_html_form; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch form

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Removed unused features from default feature set.
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/client/request.rs (1)

412-427: Add comprehensive test coverage for query and form serialization edge cases.

Neither .query() nor .form() has dedicated tests. Add regression tests covering repeated keys (e.g., foo=a&foo=b), space encoding, empty/optional fields, and nested structures to ensure output compatibility with the current serde_html_form backend.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/client/request.rs` around lines 412 - 427, Add comprehensive unit tests
for RequestBuilder::query (and the form serialization path) to cover
serialization edge cases: repeated keys (e.g., foo=a&foo=b), space encoding (" "
-> + or %20 as expected by serde_html_form), empty and Option<T> fields (omitted
vs empty values), and nested structures (maps/structs/arrays) to lock in current
serde_html_form behavior; create test cases that build a RequestBuilder, call
query(...) (and the equivalent form serialization helper) with each input shape,
assert the resulting URI query string (or form body) equals the expected encoded
string, and include regression tests for any previously failing examples so
future changes to RequestBuilder::query or the form path are caught.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/client/request.rs`:
- Around line 412-427: Add comprehensive unit tests for RequestBuilder::query
(and the form serialization path) to cover serialization edge cases: repeated
keys (e.g., foo=a&foo=b), space encoding (" " -> + or %20 as expected by
serde_html_form), empty and Option<T> fields (omitted vs empty values), and
nested structures (maps/structs/arrays) to lock in current serde_html_form
behavior; create test cases that build a RequestBuilder, call query(...) (and
the equivalent form serialization helper) with each input shape, assert the
resulting URI query string (or form body) equals the expected encoded string,
and include regression tests for any previously failing examples so future
changes to RequestBuilder::query or the form path are caught.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 658874e1-badb-4100-9f74-6394a144d291

📥 Commits

Reviewing files that changed from the base of the PR and between 805673e and f447753.

📒 Files selected for processing (2)
  • Cargo.toml
  • src/client/request.rs

@0x676e67 0x676e67 merged commit 9190a5d into main Apr 16, 2026
24 checks passed
@0x676e67 0x676e67 deleted the form branch April 16, 2026 03:46
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.

Query: replace serde_urlencoded with serde_html_form

1 participant