ZF-7406: Zend_Json_Server_Request setId is converting the id to a string instead of the required int value in the specification for jsonRPC

Description

Checked against version 1.9.0b1 and 1.8.4

/Zend/Json/Server/Request.php setId


$this->_id = (string) $name;

should be


        if (!is_numeric($name)) {
                # todo: throw exception
            $this->_id = (string) $name;
        } else {
            $this->_id = $name;
        }

Based on jsonRPC spec http://groups.google.com/group/json-rpc/… "This id can be used to correlate a Response with its Request. The server MUST reply with the same value."

So if the request was a string it should return a string, if the request was an int it should return an int

Comments

Set component and auto reassign

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.