Commit 5808de3
Avoid coercion of a value if it is valid (#1686)
* don't coerce param if it is valid
* still run any custom coersions
* fix enumerable type check
* one more nil check
* use coercer class instead of respond_to
* style
* add tests
* changelog
* coerce if method exists and is not json
* rename to requires_coercion?
* add spec1 parent df79bc3 commit 5808de3
File tree
4 files changed
+42
-3
lines changed- lib/grape/validations
- types
- validators
- spec/grape/validations/validators
4 files changed
+42
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
422 | 439 | | |
423 | 440 | | |
424 | 441 | | |
| |||
477 | 494 | | |
478 | 495 | | |
479 | 496 | | |
480 | | - | |
| 497 | + | |
481 | 498 | | |
482 | 499 | | |
483 | 500 | | |
| |||
499 | 516 | | |
500 | 517 | | |
501 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
502 | 523 | | |
503 | 524 | | |
504 | 525 | | |
505 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
506 | 531 | | |
507 | 532 | | |
508 | 533 | | |
509 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
510 | 539 | | |
511 | 540 | | |
512 | 541 | | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
513 | 546 | | |
514 | 547 | | |
515 | 548 | | |
| |||
0 commit comments