ZF-9517: Zend_Json_Server should allow named parameters in any order
Description
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.
Comments
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.!