ZF-11490: Zend Json Server error response with result

Issue Type: Patch Created: 2011-06-17T17:55:39.000+0000 Last Updated: 2011-09-24T14:10:54.000+0000 Status: Resolved Fix version(s): - 1.11.11 (29/Sep/11)

Reporter: Faisal (faisalr) Assignee: Bart McLeod ( Tags: - Zend_Json_Server

  • Server

Related issues: Attachments: - Response.php.patch


The server is adding result key in response even when it is error. According to… This member MUST NOT exist if there was an error invoking the method.

So using most json rpc 2.0 clients will throw an exception. I currently comment out Zend/Json/Server/Response.php line 176 to make it work with jsonrpc clients.

-- EDIT: actually its same with error at line 184. This member MUST NOT exist if there was no error triggered during invocation. - for error


Posted by Bart McLeod ( on 2011-07-07T06:55:40.000+0000

I confirmed it. The opposite is also true: if a request is succesful, an error property is included in the response, while it MUST NOT. My next action will be to create a unit test that confirms both bugs.

Posted by Bart McLeod ( on 2011-07-09T11:13:04.000+0000

Added patches for Response.php and ResponseTest.php

Posted by Bart McLeod ( on 2011-07-09T11:15:12.000+0000

Changed to patch, because there are patches now that you can use. I had to change existing unit tests, because they were wrong. The error and result may not coexist in the response.

If no one complains about the solution, I will commit this within a week. I will leave the issue open for integration in ZF 2.0

Posted by Bart McLeod ( on 2011-07-19T21:58:03.000+0000

Committed to svn trunk at revision 24251

Posted by Bart McLeod ( on 2011-07-20T04:54:20.000+0000

Merged into the 1.11 branch from revision 24251 in trunk.

Posted by Adrian Mester (ilogik) on 2011-09-23T15:26:27.000+0000

The patch seems to not have made it in the 1.11.10 release


Posted by Bart McLeod ( on 2011-09-24T12:52:11.000+0000

You are right. I can see it is not in the current 1.11 release branch. Something must have gone wrong with the original merge.

Posted by Bart McLeod ( on 2011-09-24T14:08:10.000+0000

I have merged the changes from trunk back into the 1.11 release branch and commited the changes to the 1.11 branch. With the next mini release, this should become available. Thanks for your feedback.

Posted by Bart McLeod ( on 2011-09-24T14:09:52.000+0000

'Affects versions' field updated to '1.11.10'

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.