1
Vote

Does not allow 2.0 named parameters

description

The JSON-RPC 2.0 spec allows the parameters block to be specified like this:
"params": {"subtrahend": 23, "minuend": 42}

However this implementation will reject a request formatted this way because it expects params to always be an array, and fails if it cannot count the number of parameters.

In this case the simplest, and most useful thing to do would be to pass the params object to the handling function as a raw json object. It could also try to call a method with the named parameters and handle optional parameters that were not included

comments

TomLeRoc wrote Sep 2, 2014 at 8:46 AM

Having downloaded and compiled the source code, instead of relying on nuget, the problem has gone away. It looks like the nuget package is seriously out of date. I still can't use optional parameters though

AustinHarris wrote Sep 3, 2014 at 6:16 AM

Did you pull the source from github? https://github.com/Astn/JSON-RPC.NET

There are tests written that check for optional parameter support.. They should pass.
https://github.com/Astn/JSON-RPC.NET/search?utf8=%E2%9C%93&q=optional

and they did with the last release on Jun 3
v1.0.4.20 …
Version v1.0.4.20 - MyGet Build Services

https://github.com/Astn/JSON-RPC.NET/releases

Did you get this nuget package and it was out dated? JSON-RPC.NET Core 1.0.4.18?

And, fee free to post over at github. :)

rams78 wrote Feb 25, 2015 at 3:04 PM

Same here. The version I got from nuget is 1.0.2.0