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

faulty answer string with batches that contain requests with and without id's

Open HoMS1987 opened this issue 2 years ago • 1 comments

When I process a JSON request batch, for example:

[{"jsonrpc":"2.0","method":"NewMeasureValues","params":{"Values":[{"Timestamp": null, "Mass":1},{"Timestamp": "2022-04-29T09:51:15.1961814Z", "Mass":2}]},"id":32},{"jsonrpc":"2.0","method":"NewMeasureValues","params":{"Values":[{"Timestamp": null, "Mass":1},{"Timestamp": "2022-04-29T09:51:15.1961814Z", "Mass":2}]}}]

where the first request in the batch has an id and the second doesn't, the answer string I get with

JsonRpcProcessor.Process(receivedJsonString, this)

is an empty string. When it is the other way around, i get the following answer string:

{"jsonrpc":"2.0","result":null,"id":32}]

There the "[" at the beginning is missing.

What I would expect as answer would be:

[{"jsonrpc":"2.0","result":null,"id":32}]

in both cases.

HoMS1987 avatar Apr 29 '22 11:04 HoMS1987

oh good find!

Astn avatar Jun 08 '22 17:06 Astn