Commit 4f0e1b8
committed
feat: implement the URL search params serialization standard
Port @seamapi/url-search-params-serializer to Python so the SDK can
serialize objects to URL search params for HTTP GET requests.
Output is byte-for-byte identical to the reference implementation:
- Values are encoded with the application/x-www-form-urlencoded
serializer, which differs from urllib in its treatment of "*" and "~".
- Params are sorted by name, compared by UTF-16 code unit.
- Floats are formatted using the ECMAScript Number::toString algorithm,
which differs from repr for integral floats and around the exponent
notation thresholds.
Python has no undefined, so UNDEFINED is provided as the sentinel for a
removed param, while None serializes to an empty value as null does.
Temporal.Instant and Date both map to datetime, where a naive datetime is
interpreted as UTC and microseconds are truncated to millisecond
precision.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpqwDhZmyikGbjmCPqFW2A1 parent 4f9cc47 commit 4f0e1b8
4 files changed
Lines changed: 960 additions & 0 deletions
File tree
- seam
- utils
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
436 | 438 | | |
437 | 439 | | |
438 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
439 | 484 | | |
440 | 485 | | |
441 | 486 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments