Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When implementing a JSONRPC 2.0 server, is it required to support both named, and positional arguments?

Tags:

json-rpc

According the spec here: http://groups.google.com/group/json-rpc/web/json-rpc-2-0

more specifically, this section:

If present, parameters for the rpc call MUST be provided as a Structured value. Either by-position through an Array or by-name through an Object.

To me it seems obvious that both styles must be supported, however I've filed a bug report and another developer feels that it's up the developers to decide which method to support, and that the spec doesn't require both.

I can't find an official answer, other than what I quoted above, which the other developer doesn't interpret the same way I do.

So, what is the general consensus?

like image 339
user61000 Avatar asked Oct 24 '25 02:10

user61000


1 Answers

I agree fully, it is clearly outlined in the above documentation. The word "must" in 4.2 sentence one requires a "structured value". The "structured value" is later defined by the second sentence. To ignore one of the options would be to change the definition of "structured value" which is a violation of JSON-RPC 2.0 Specification

  1. If present, parameters for the rpc call MUST be provided as a Structured value.
  2. Either by-position through an Array or by-name through an Object.
like image 101
digacid Avatar answered Oct 27 '25 02:10

digacid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!