Commit 550da75
authored
Fix: BadMapError when page param is not using bracket notation (#407)
When clients send page parameter as a string (e.g., page={"limit":1})
instead of bracket notation (page[limit]=1), the pagination code would
crash with a BadMapError when calling Map.fetch on the string.
This adds a guard clause to fetch_pagination_parameters that detects
when page is a binary string and returns a structured 400 error
explaining the correct format, instead of crashing with a 500.
JSON:API spec requires bracket notation for nested query parameters.1 parent 42a1fd5 commit 550da75
2 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
936 | 947 | | |
937 | 948 | | |
938 | 949 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
119 | 134 | | |
120 | 135 | | |
0 commit comments