? ? Pending

User tests: Successful: Unsuccessful:

avatar wilsonge
wilsonge
16 Mar 2020

Pull Request for Issue #26925 .

Summary of Changes

Adds plugin events to allow extensions to add custom properties to the API Response. Right now this deliberately doesn't allow modification of the existing properties but that will presumably come in the future as the data stabilizes.

Also has some small cleanups to the Joomla Serializer as I went through this.

Testing Instructions

plg_system_demo.zip

Install this extension (enabling it etc) and check that the retrieving an article through the API includes extra properties. There should be one relation and one custom property added to the response.

EDIT: I've also tried to doc blocks in the plugin to explain the options and what you can do

Documentation Changes Required

Needs to be documented how to add these properties (using the plugin as the example)

//cc @nikosdion

avatar wilsonge wilsonge - open - 16 Mar 2020
avatar wilsonge wilsonge - change - 16 Mar 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Mar 2020
Category Libraries
avatar wilsonge wilsonge - change - 16 Mar 2020
Labels Added: ? ?
a7f2fb2 16 Mar 2020 avatar wilsonge PHPCS
avatar wilsonge wilsonge - change - 16 Mar 2020
Title
[4.0] Allow extensions to add custom data to other extensions
[4.0] Allow extensions to add custom data to other extensions in the API
avatar wilsonge wilsonge - edited - 16 Mar 2020
avatar nikosdion
nikosdion - comment - 17 Mar 2020

My first impression is that it's pretty much what we discussed.

However, reading code is one thing, executing it is another. I'll definitely take a look over the weekend when I have more time; I'm currently in the tail end of a major JavaScript refactoring while trying to also deal with the second order effects of the “social distancing” measures due to the CoViD-19 outbreak.

Stay home and stay safe, mate.

avatar wilsonge wilsonge - change - 17 Mar 2020
The description was changed
avatar wilsonge wilsonge - edited - 17 Mar 2020
avatar wilsonge wilsonge - change - 17 Mar 2020
The description was changed
avatar wilsonge wilsonge - edited - 17 Mar 2020
avatar alikon
alikon - comment - 17 Mar 2020

ok so i've tested this pr and it works as it has been described
but maybe i'm too naive
till now i'm still harding finding without proper docs how this is intented to work with differnt use cases

"text":"<p>Art1<\/p> ","tags":[],"customPropertyToRender":1}}],"meta":{"total-pages":1}}

avatar wilsonge
wilsonge - comment - 17 Mar 2020

So the property looks fine. The relation you'll only see if you go to a single item view (which according to the JSON API spec is the only time your going to see it).

till now i'm still harding finding without proper docs how this is intented to work with differnt use cases

What are you looking for? There is already a limited selection of docs pages. https://docs.joomla.org/Category:Joomla!_Api I need to know what you are missing.

avatar wilsonge
wilsonge - comment - 24 Mar 2020

@nikosdion are you going to be able to test this in the near future - appreciate with things so much in flux at the moment it's hard - trying to get this in so I can start to write some docs up about integrating with the API

avatar alikon
alikon - comment - 31 Mar 2020

I have tested this item successfully on 542ace5


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28377.

avatar alikon alikon - test_item - 31 Mar 2020 - Tested successfully
avatar wilsonge
wilsonge - comment - 1 Apr 2020

@nikosdion are you going to have time to test this one or should i just get it in and let you test in a nightly whenever you the time?

avatar nikosdion
nikosdion - comment - 1 Apr 2020

Sorry for the delay. We were having some trouble with the power and Internet connection. I'll try to find some time until Sunday evening. If you don't hear back from me by Monday assume I can't test it within a realistic amount of time.

avatar wilsonge
wilsonge - comment - 1 Apr 2020

No worries! Good luck getting things sorted!

avatar wilsonge wilsonge - change - 6 Apr 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-04-06 08:52:23
Closed_By wilsonge
avatar wilsonge wilsonge - close - 6 Apr 2020
avatar wilsonge wilsonge - merge - 6 Apr 2020

Add a Comment

Login with GitHub to post a comment