Commit 2aa3b3d
Parse request bodies with JSON.parse in the stdlib fallback
Restore the original `Grape::Json = ::JSON` stdlib fallback (the wrapper
module added in #2759 is no longer needed) and fix the json_class
deserialization vector at its source: parse incoming bodies with
JSON.parse instead of JSON.load.
JSON.parse never honours the json_class additions mechanism, so it keeps
json_class payloads inert without the create_additions: false wrapper,
without the per-call delegation, and without depending on JSON.load's
shifting defaults (deprecated since json 2.8.0, defaulting to false in 3.0).
Net change vs. master: lib/grape/json.rb returns to its pre-#2759 shape;
lib/grape/parser/json.rb switches .load to .parse.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0f9f44f commit 2aa3b3d
4 files changed
Lines changed: 6 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 7 | + | |
| 8 | + | |
18 | 9 | | |
19 | 10 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
0 commit comments