techjoomla / com_api

API framework for Joomla
http://docs.techjoomla.com/joomla-rest-api/com-api-introduction
GNU General Public License v3.0
123 stars 97 forks source link

Task #102557 Creating envelope for com-api-plugins #42

Closed UmeshBhosale closed 7 years ago

coolbung commented 7 years ago

Ok. How are we handling the envelope template ? How will it be overriden ?

On Thu, Jun 1, 2017 at 9:23 AM, twsvaishali notifications@github.com wrote:

@twsvaishali commented on this pull request.

In code/site/libraries/plugin.php https://github.com/techjoomla/com_api/pull/42#discussion_r119543890:

@@ -526,7 +560,16 @@ protected function toJson() } else {

  • return json_encode($this->get('response'));
  • require_once JPATH_SITE.'/components/com_api/views/view.json.php';

later, we decided we wont need this file. Have told Umesh and Vivek but missed commenting here.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/techjoomla/com_api/pull/42#discussion_r119543890, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaNM6XagdsAIPez4iDOJNvHjGhMHZytks5r_mb-gaJpZM4NCw9T .

-- Thanks! Ashwin Date techjoomla.com http://techjoomla.com/?utm_source=email_signature&utm_medium=email&utm_campaign=ashwin | appcarvers.com http://appcarvers.com/?utm_source=email_signature&utm_medium=email&utm_campaign=ashwin | tekdi.net http://tekdi.net/?utm_source=email_signature&utm_medium=email&utm_campaign=ashwin @coolbung | @techjoomla | @appcarvers | @tekdinet

If it isn't broken, don't fix it!

vaivk369 commented 7 years ago

@manojLondhe @coolbung

We have written a new function setApiResponse which will be called by newly created plugins, who wants to send reply in following format:

{ "err_code": "", "err_message": "", "data": { "result": [ ] } }

As this is the new function,old APIs will call the setResponse function and can work.

UmeshBhosale commented 7 years ago

@manojLondhe We have written a new method named 'setApiResponse()'. Those who wants new response format can use this method. Otherwise, the com-api can work on previous method namely 'setResponse()'. So it won't break anything for other com-api consumers. However to get advantages of this release they should update their resources too.