Repository navigation
Commit a61c97c
authored
fix(parser)!: parse numbers with the invariant culture only (#121)
The number grammar also accepted the decimal separator of the current culture. Under de-DE, Rating > 4,5 parsed, and the value conversion read it with the invariant culture as 45. The API returned wrong rows with no error.
The number grammar, the count operator value, and the literal checks in IsPropertyPath now use the invariant culture only. A number always uses the '.' decimal point.
BREAKING CHANGE: a number with a decimal comma, for example Rating > 4,5, throws a QueryKitException in every culture. Before, a server with a comma culture read this value as 45. Send the number with a '.' decimal point, for example Rating > 4.5.1 parent 0f82f3d commit a61c97c
3 files changed
Lines changed: 7 additions & 34 deletions
File tree
- QueryKit.UnitTests
- QueryKit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 31 | + | |
| 32 | + | |
42 | 33 | | |
43 | 34 | | |
44 | 35 | | |
45 | | - | |
| 36 | + | |
46 | 37 | | |
47 | 38 | | |
48 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
| 259 | + | |
270 | 260 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | 261 | | |
278 | 262 | | |
279 | 263 | | |
| |||
344 | 328 | | |
345 | 329 | | |
346 | 330 | | |
347 | | - | |
| 331 | + | |
348 | 332 | | |
349 | 333 | | |
350 | 334 | | |
| |||
580 | 564 | | |
581 | 565 | | |
582 | 566 | | |
583 | | - | |
| 567 | + | |
584 | 568 | | |
585 | 569 | | |
586 | 570 | | |
| |||
1542 | 1526 | | |
1543 | 1527 | | |
1544 | 1528 | | |
1545 | | - | |
1546 | | - | |
| 1529 | + | |
1547 | 1530 | | |
1548 | 1531 | | |
1549 | 1532 | | |
| |||
0 commit comments