ZF-9517: Zend_Json_Server should allow named parameters in any order

Issue Type: Patch Created: 2010-03-23T09:31:29.000+0000 Last Updated: 2010-05-26T13:59:14.000+0000 Status: Resolved Fix version(s): - 1.10.5 (26/May/10)

Reporter: A.J. Brown (ajbrown) Assignee: Andy Fowler (andyfowler) Tags: - Zend_Json_Server

Related issues: - ZF-6131

Attachments: - Zend_Json_Server.diff


When using named parameters in the 2.0 JSON-RPC spec, Zend_Json_Server should allow parameters to be passed in any order. Currently, names of parameters are ignored and the parameters are passed to the service method in the order they are supplied by the client.

I've created a patch which uses reflection to reorder the passed parameters when an associative array is detected. This is done before they are passed down to Zend_Server_Abstract since all specifications utilizing that class aren't equal. It may be worth discussing if it should be moved down, though.


Posted by A.J. Brown (ajbrown) on 2010-04-12T12:52:11.000+0000

I am now using this patched version in production without issue. I've also added to the tests, covering the changes.

See the provided patch. I'd love to get this into the next release, so I can drop my local patches.

Posted by A.J. Brown (ajbrown) on 2010-04-12T12:52:40.000+0000

Patch with fix and unit test.

Posted by Andy Fowler (andyfowler) on 2010-05-21T17:01:27.000+0000

Tested, formatted, applied ajbrown's patch. (This is my first actual commit.. bear with me) :)

Thanks A.J.!

Have you found an issue?

See the Overview section for more details.


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

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