ZF-2540: Support optional parameters in methods in Zend_Rest_Server

Issue Type: Patch Created: 2008-01-31T15:51:33.000+0000 Last Updated: 2009-01-11T04:14:28.000+0000 Status: Resolved Fix version(s): - 1.7.0 (17/Nov/08)

Reporter: Jessie Hernandez (jrhernandez) Assignee: Benjamin Eberlei (beberlei) Tags: - Zend_Rest_Server

  • Zend_Server_Reflection

Related issues: - ZF-1949

Attachments: - rest_optional_args.patch


Zend_Rest_Server does not currently support optional parameters for REST methods. It currently requires all parameters to be passed to the method.

I have attached a small patch that enables support for optional parameters, and changed the error logic to only throw an error when one or more required parameters are mssing.


Posted by Jessie Hernandez (jrhernandez) on 2008-01-31T16:05:26.000+0000

This patch adds optional argument support for Zend_Rest_Server.

Posted by Jessie Hernandez (jrhernandez) on 2008-01-31T17:15:03.000+0000

This is an alternate patch for consideration. It only contains three new lines to support optional parameters.

Posted by Thomas Weidner (thomas) on 2008-03-12T14:33:53.000+0000

If you are not able to commit a patch to trunk, you should un-assign the issue from you. Otherwise you should commit the patch. :-)

Posted by Jessie Hernandez (jrhernandez) on 2008-03-12T15:10:24.000+0000

Thanks for the tip, Thomas! I don't have access to commit (yet), so I unassigned the issue.

Posted by Thomas Weidner (thomas) on 2008-03-13T15:24:19.000+0000

Here is a comment from matthew:

We cannot use the patch as is. The functionality needs to be added at the Zend_Server_Reflection level (the patch provided is a band-aid and would not fix the same type of issue with the XML-RPC server). Additionally, the patches do notinclude unit tests, and we cannot integrate without unit tests.

So we will not add this patch as is... but see the benefit of functionality. We will cover this later on... Feel free to add this functionality the way matthew described.

Every help is appreciated.

Posted by Jessie Hernandez (jrhernandez) on 2008-03-13T22:03:22.000+0000

What changes need to be done exactly on Zend_Server_Reflection? I'll add the unit tests too, just need to know what needs to be done on the Reflection side.

Posted by Thomas Weidner (thomas) on 2008-03-14T02:22:55.000+0000

This feature has to be added to the Reflection Class which is the origin of Zend_Rest. So we have a solution for all classes which extend Zend_Server (Zend_Rest, Zend_XmlRpc, Zend_Server, Zend_Http...).

If you do not know what exactly to do, it would be best to ask Matthew in the webservices mailinglist as he is the Server-Guru ;-)

Posted by Matthew Weier O'Phinney (matthew) on 2008-05-09T11:54:41.000+0000

Scheduling for next minor release.

Posted by Benjamin Eberlei (beberlei) on 2009-01-11T04:12:03.000+0000

It seems ZF-1949 also fixed this issue.

Posted by Benjamin Eberlei (beberlei) on 2009-01-11T04:14:28.000+0000

Was already fixed by ZF-1949

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.