Commit 3d7c1c6
committed
Handle missing JSON-RPC params and add test
Add #[serde(default)] to JsonRpcCall.params so requests that omit the params field deserialize to Value::Null instead of failing. Also add a unit test verifying that a JSON-RPC request without params is parsed as a Single JsonRpcRequest and that call.params == Value::Null. This makes the JSON-RPC input handling more robust for requests that don't include params.1 parent 58d5ec2 commit 3d7c1c6
1 file changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
214 | 229 | | |
215 | 230 | | |
216 | 231 | | |
| |||
0 commit comments