graze / guzzle-jsonrpc

JSON-RPC 2.0 client for Guzzle
https://packagist.org/packages/graze/guzzle-jsonrpc
MIT License
93 stars 61 forks source link

jsonrpc is not a required response parameter #4

Closed dantudor closed 10 years ago

dantudor commented 10 years ago

jsonrpc parameter is not deemed required by either the 1.0 or 2.0 JSON-RPC Spec

I removed the check in the response constructor and removed the test.

adlawson commented 10 years ago

Hi @dantudor. Looking at the v2.0 specification, the jsonrpc parameter is explicitly mentioned in a few areas

Reading through these sections it would seem the field is required, and I'm inclined to continue validating against it until I see documentation directly referring to it as optional in 2.0. If you can show a case for removing it from the validation, I'd be happy to review it. Thanks.

dantudor commented 10 years ago

Hi Andrew,

I'm working with a 1.0 server. A response object that forces the requirement of there being a jsonrpc key has effectively broken BC with 1.0. Understand 1.0 support is not key for your project as you must be using a 2.0 server. I'll run a fork for my dev purposes.

cheers

Dan

interface JsonRpcClientInterface extends ClientInterface
{
    /**
     * @const string
     */
    const VERSION = '2.0';

EDIT: Just noticed the lib does enforce 2.0 intentionally.