-
-
Notifications
You must be signed in to change notification settings - Fork 0
🚸 change Qs.Decode
return from Dictionary<object, object?>
to Dictionary<string, object?>
#2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe decode API now returns Dictionary<string, object?> throughout, replacing object-keyed maps. Decoder and utils were updated to produce and convert to string-keyed dictionaries, including deep conversion with cycle/identity handling. Tests were adjusted accordingly. Extensions.ToQueryMap and Qs.Decode signatures now reflect string keys. Minor csproj formatting change. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Extensions
participant Qs
participant Decoder
participant Utils
Caller->>Extensions: ToQueryMap(query, options)
Extensions->>Qs: Decode(query, options)
Qs->>Decoder: ParseObject/Decode internals (object-keyed interim)
Decoder-->>Qs: Object-keyed result
Qs->>Utils: Compact(object-keyed)
Utils-->>Qs: Compacted (object-keyed)
Qs->>Utils: ToStringKeyDeepNonRecursive(compacted)
Utils-->>Qs: String-keyed Dictionary<string, object?>
Qs-->>Extensions: String-keyed map
Extensions-->>Caller: Dictionary<string, object?>
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (8)
🧰 Additional context used🧬 Code Graph Analysis (6)QsNet/Extensions.cs (3)
QsNet/Qs.cs (4)
QsNet/Internal/Decoder.cs (4)
QsNet.Tests/UtilsTests.cs (5)
QsNet.Tests/Fixtures/Data/EmptyTestCases.cs (4)
QsNet/Internal/Utils.cs (5)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (33)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Dictionary<object, object?>
to Dictionary<string, object?>
Qs.Decode
return from Dictionary<object, object?>
to Dictionary<string, object?>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
This pull request updates the unit tests in
QsNet.Tests/ExampleTests.cs
to useDictionary<string, object?>
instead ofDictionary<object, object?>
for all expected decoded results. This change ensures that all dictionary keys are consistently typed as strings, which better matches typical query string decoding output and improves type safety and clarity in the tests.Test type consistency improvements:
Dictionary<string, object?>
rather thanDictionary<object, object?>
, both for top-level and nested dictionaries. This applies to simple key-value pairs, nested maps, and decoded lists. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31]List and map decoding behavior:
"100"
instead of100
). [1] [2] [3] [4]Nested and mixed structure handling:
Duplicate key handling:
Charset and encoding options:
Dictionary<string, object?>
. [1] [2] [3] [4]Summary by CodeRabbit
New Features
Refactor
Tests
Chores