Commit bca7bcc
authored
🐛 fix decode dot in keys (#25)
* ♻️ refactor DecodeOptions to support legacy decoders and add unified decode methods
* 🐛 fix top-level dot splitting in keys to preserve encoded dots and handle degenerate cases
* 🐛 normalize percent-encoded dots in bracketed keys when decode_dot_in_keys is enabled
* ✅ add tests for DecodeOptions dot-in-keys and custom decoder behaviors
* ✅ add CSharp parity tests for encoded dot behavior in DecodeOptions
* ✅ add tests for decoder precedence over legacy_decoder and non-string decoder results in DecodeOptions
* 🐛 handle leading dot in keys by converting to bracket segment in dot_to_bracket_top_level
* ✅ add tests for dot encoding and decoding parity across DecodeOptions configurations
* 💡 update docstring to clarify handling of degenerate cases and unterminated brackets in top-level dot splitting
* 💡 clarify docstrings for list_limit, comma-splitting, and percent-encoded dot handling in decode logic
* ♻️ update type annotations in decode_options_test for decoder and legacy_decoder signatures
* ✅ revise decode test to avoid duplicate dict key assertion and ensure decoder invocation for dot-encoded and bracketed keys
* 💡 update comment to clarify top-level dot splitting behavior in decode logic
* 💡 add comment to clarify handling of typing.Literal annotations for kind parameter in decode logic
* 💡 clarify comment on comma-split list logic and list_limit enforcement in decode function
* 💡 add comment to clarify normalization of percent-encoded brackets in query string prior to splitting
* 💡 add comment to clarify conservative heuristic for list length enforcement in decode logic
* 💡 update comment to clarify percent-decoding behavior and handling of encoded dots in dot_to_bracket_top_level
* 🐛 fix strict_depth enforcement to avoid raising on unterminated bracket groups in decode logic
* 💡 clarify docstring on decode_key to note coercion of non-string decoder outputs via str()
* 🐛 fix dot-to-bracket decoding to preserve leading dots in consecutive dot sequences
* 💡 add examples to docstring for decode_key to illustrate max_depth and unterminated bracket handling
* 💡 document that 'kind' parameter in decode_scalar is ignored and may be removed in future
* 💡 clarify KEY docstring to note default decoder behavior for percent-encoded dots
* ✅ add tests for split_key_into_segments remainder handling and strict depth enforcement
* 🐛 fix percent-decoding to handle dot in keys and clarify top-level percent sequence handling
* 🐛 handle ambiguous '.]' in key decoding and prevent bracket segment overrun on closing brackets
* 💡 update decode_kind docstring to clarify scalar decoder behavior for percent-decoded dots in keys
* 💡 clarify docstring to specify dot splitting only occurs on actual '.' at depth 0, not percent-encoded sequences1 parent 2c3e103 commit bca7bcc
6 files changed
Lines changed: 666 additions & 151 deletions
File tree
- src/qs_codec
- enums
- models
- utils
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
133 | 140 | | |
134 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
135 | 145 | | |
136 | 146 | | |
137 | 147 | | |
| |||
155 | 165 | | |
156 | 166 | | |
157 | 167 | | |
158 | | - | |
| 168 | + | |
159 | 169 | | |
160 | 170 | | |
161 | | - | |
| 171 | + | |
162 | 172 | | |
163 | | - | |
164 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
165 | 177 | | |
166 | | - | |
| 178 | + | |
167 | 179 | | |
168 | 180 | | |
169 | | - | |
| 181 | + | |
| 182 | + | |
170 | 183 | | |
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
174 | 191 | | |
175 | 192 | | |
176 | 193 | | |
| |||
296 | 313 | | |
297 | 314 | | |
298 | 315 | | |
299 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
300 | 324 | | |
301 | 325 | | |
302 | 326 | | |
303 | 327 | | |
304 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
305 | 342 | | |
306 | 343 | | |
307 | 344 | | |
| |||
329 | 366 | | |
330 | 367 | | |
331 | 368 | | |
332 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
333 | 375 | | |
334 | 376 | | |
335 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
0 commit comments