Does the Joomla! 4 Web Services currently support fields sorting, sparse fieldsets, and inclusion of related resources #35404
Replies: 3 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
I worked on the sparse fieldset feature. It seems to work but the problem is that it process the results after the http request was made and manipulate the resulting array using SplRecursiveArrayIterator and SplRecursiveIteratorIterator. What would be nice is to find a way in do this processing inside the ListModel but just for the ApiListModel. For example by using a mutable plugin Event. Eg: ApiBeforeRenderResponse or something like that. What do you think about this Super Joomlers? |
Beta Was this translation helpful? Give feedback.
-
Hello Super Joomlers! I was working on sparse fieldset feature in JSON API spec added to Joomla! 4 using a system plugin. Now it works. The code will be available soon on github. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Super Joomlers!
I have looked into the code of Joomla! 4 but I am not sure to have seen something related to those 3 out of 5 possibilities regarding the JSON API Specification v1.0
As far as I found currently Joomla! 4 supports filtering and pagination via query string when calling a Joomla! 4 Web Service enpoint using respectively for example filter[search]=something and/or page[offset]=10&page[limit]=50
But what I haven't found yet is something that is in the spec like
Inclusion of related resources on the fly: include=articles.created_by (in our case) to just fetch that
Sparse fieldset: fields[type]=field1,field5 in our case for example fields[articles]=id,title,state
And lastly in the spec too fields sorting: sort=id,-title,-created which would be id ASC, title DESC, created date DESC
Is this implemented or am I missing something? @wilsonge
Beta Was this translation helpful? Give feedback.
All reactions