JSON-RPC.NET icon indicating copy to clipboard operation
JSON-RPC.NET copied to clipboard

Single response when sending batch request.

Open hovi opened this issue 2 years ago • 2 comments

When I send multiple request in batch array, I get correctly results. When I send single request, I get the result without array brackets. The specification is a bit confusing, but I expect this is incorrect. It is certainly breaking my client expectations :-D Some examples follow.

Correct with 2 requests:

Request

[{"id":1849316922322121888,"jsonrpc":"2.0","method":"Observer.SwitchCamera","params":{}},{"id":732138300415643188,"jsonrpc":"2.0","method":"Observer.SwitchCamera","params":{}}]

Response
[{"jsonrpc":"2.0","result":null,"id":1849316922322121888},{"jsonrpc":"2.0","result":null,"id":732138300415643188}]



Request [{"id":2419378167359262235,"jsonrpc":"2.0","method":"Observer.SwitchCamera","params":{}}]

Response missing array brackets {"jsonrpc":"2.0","result":null,"id":2419378167359262235}


hovi avatar Nov 03 '22 16:11 hovi

Ahh, good find. Did you already make a fix?

Astn avatar Mar 13 '24 00:03 Astn

Nah sorry, I don't have .NET setup anymore and did workaround on my client side.

hovi avatar Mar 19 '24 05:03 hovi