Using the json api I am able to successfully create articles and contacts - woohoo
I am also able to update basic fields in articles and contacts
The only thing that I have not been able to do (so far) is to change the value of the "state" field of an article
I can change the value of the "published" field in a contact
I am "guessing" that its com_workflow related??
Labels |
Added:
?
|
OK thanks
Also regarding the list of fields that are returned in a get request. I see that the list is in the JsonapiView.php but how was the list chosen. Sometimes it is every field in the table eg banners and sometimes it is the absolute minimum eg contacts
In the first PR of com_content it was just the basic core fields. When we did the second round of components it was supposed to be expanded to cover everything largely useful. The aim of the core API is to expose everything practically useful. So if stuff's missing it should be added
https://github.com/joomla/joomla-cms/pull/23424/files#r245485858
I guess I now understand why :)
The aim of the core API is to expose everything practically useful.
Hard to say what will be useful ;)
So if stuff's missing it should be added
I would suggest to add any field thats displayed in the UI
com_banners seems to be everything in the banners table
com_contact seems to be the absolute minimum
I am still learning this but we can talk on tuesday and work out a plan
Yup. I more mean for example in menus I don't want to show lft/rgt values - that kinda thing. anything in the UI basically should be and possibly even a few extra things too.
Can definitely talk tuesday
I will make a list of issues/questions
i mean not the untranslated string, but that we are only logging the authentication and not an information on what webservice has been called
Imagine that state is a read only field. Update the transition
field in the API to execute a transition using the transition id. That should have the effect of updating the state
so updating the transition will automagically update the state?
Yes - that's exactly how workflows work in the UI right now (for reference it triggers https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/Helper/ContentHelper.php#L84 this function)
The aim of the core API is to expose everything practically useful.
Hard to say what will be useful ;)
So if stuff's missing it should be added
I would suggest to add any field thats displayed in the UI
I noticed that every API expose a list of pagination links, like this:
{
"links": {
"self": "http:\/\/localhost\/api\/index.php\/v1\/config\/application",
"first": "http:\/\/localhost\/api\/index.php\/v1\/config\/application?page[offset]=0&page[limit]=20",
"next": "http:\/\/localhost\/api\/index.php\/v1\/config\/application?page[offset]=20&page[limit]=20",
"previous": "http:\/\/localhost\/api\/index.php\/v1\/config\/application?page[offset]=0&page[limit]=20",
"last": "http:\/\/localhost\/api\/index.php\/v1\/config\/application?page[offset]=80&page[limit]=20"
},
and all links are always available, even though they make no sense (i.e. First and Previous in the first page, Next and Last when the last page is reached). In the UI these buttons are disabled:
I suppose unnecessary links could be avoided...
https://jsonapi.org/format/#fetching-pagination
Keys MUST either be omitted or have a null value to indicate that a particular link is unavailable.
We can probably make some of these links null to reflect that. All that code lives here https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/MVC/View/JsonApiView.php#L138-L176 so feel free to tweak it!
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-12-19 03:14:58 |
Closed_By | ⇒ | wilsonge |
Im going to close this as I think the original issue has been answered. Lots of the fields have since been standardised and we can open specific issues for anything that hasn’t been addressed
Yup definitely workflow related. I dunno how it's working in practice. But in theory state is a readonly field and you're going to modify the
transition
field in the API (which helpfully I'm not returning back because the com_content code massively predates that!)