User tests: Successful: Unsuccessful:
Pull Request for Issue #45178.
This PR updates the Schemaorg system plugin to allow it to be executed when content is saved via API client, in addition to administrator client. This enables schema metadata to be processed properly for content created or updated through Joomla's REST API.
Enable the Schemaorg plugin in the backend.
Use Joomla REST API to create or update an article.
Check if schema metadata is generated or excepted.
Verify that the plugin continues to work correctly in the admin interface as before.
Schemaorg plugin does not execute when content is saved via API.
Schemaorg plugin supports execution via both admin and API clients.
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Front End Plugins |
Labels |
Added:
PR-5.2-dev
|
@Sanjana2906 Thanks for rebasing. Unfortunately you have also pished your .htaccess file. Could you revert that?
Labels |
Added:
PR-5.3-dev
|
@richard67 Thanks for the review! I've reverted the '.htaccess' commits . The branch is now synced with '5.3-dev' .
@richard67 Thanks for the review! I've reverted the '.htaccess' commits . The branch is now synced with '5.3-dev' .
@Sanjana2906 Now you deleted the htaccess.txt
file. Could you revert that, too? Your PR should show only the desired changes here: https://github.com/joomla/joomla-cms/pull/45319/files
@brianteeman Appreciate the link- that was helpful, Thank you!
@Sanjana2906 Thanks. PR looks good now.
@richard67 Thanks for catching that! I've reverted the accidental deletion of 'htaccess.txt' and restored it from '5.3-dev'. The PR now only includes schema.org API support changes.
can you please document what the payload should be ? for POST/PATCH/GET the schemaorg
@alikon
I've compiled comprehensive documentation covering the payload for POST, PATCH and, GET requests . You can find the full detail here: [ https://github.com/joomla/joomla-cms/compare/5.3-dev...Sanjana2906:joomla-cms:schemaorg-doc-pr?expand=1#diff-431d327d47e0b4f79604cd2b0a778cac5d94376db392cde6f1e2aa16181316c2 ] .
Thank you for the feedback.
with this pr
i've POSTed an article with the following payload
{
"title" : "Test Article",
"catid": 2,
"language": "*",
"@type" : "Article",
"articletext" : "Content",
"author": {
"type" : "Person",
"name" : "John-doe",
"email" : "john@example.com"
}
}
but when i execute the GET
{
"links": {
"self": "http://localhost/530/api/index.php/v1/content/articles/107"
},
"data": {
"type": "articles",
"id": "107",
"attributes": {
"typeAlias": "com_content.article",
"id": 107,
"asset_id": 168,
"title": "Test Article",
"alias": "test-article",
"state": 0,
"created": "2025-04-15 12:54:59",
"created_by": 506,
"created_by_alias": "",
"modified": "2025-04-15 12:54:59",
"modified_by": 506,
"publish_up": null,
"publish_down": null,
"images": [],
"urls": [],
"version": 1,
"metakey": "",
"metadesc": "",
"access": 1,
"hits": 0,
"metadata": [],
"featured": 0,
"language": "*",
"note": "",
"tags": [],
"featured_up": null,
"featured_down": null,
"text": "Content "
},
"relationships": {
"category": {
"data": {
"type": "categories",
"id": "2"
}
},
"created_by": {
"data": {
"type": "users",
"id": "506"
}
},
"tags": {
"data": []
},
"modified_by": {
"data": {
"type": "users",
"id": "506"
}
}
}
}
}
i don't see any schemaorg related data , all the schemaorg plugins are enabled
Hi @alikon ,
Thanks for testing and for the detailed observation.
You're right - currently the structured data ( Schema.org ) is successfully handled during the POST, but it's not yet returned in the GET response. This is because Joomla's core API doesn't automatically include plugin metadata unless we explicitly inject it into the response. I'll extend the implementation to include that by injecting the data during API response generation.
Appreciate you pointing that out - I'll follow up with the necessary changes.
Title |
|
Title |
|
I rebased this feature pr against 6.0, also please remove the documentation from the pr and create an entry in manual.joomla.org (since we don't have a clean documentation for api in the manual yet please add it to this section.
I also changed the pr to draft till it's complete
I'll be drafting the updated API documentation and adding it to Joomla Manual by tomorrow. Please let me know if there are specific guidelines or details you'd like me to include.
Hi @HLeithner, @alikon,
Thanks for the feedback and for moving the PR to 6.0-dev. I've written the documentation under docs/webservices/schemaorg-api-support.md as suggested — feel free to let me know if the placement looks okay.
I’ve also tested again by POSTing an article with the schema.org metadata, but I’m still not seeing any schema data returned in the GET response. The Schemaorg plugins are all enabled, but it doesn’t seem like they’re being triggered.
I’ve tried using the onAfterApiData event to inject the structured data, but I’m not fully sure if that’s the best or only way — would appreciate a little guidance if I’m missing something here.
Thanks again for your help and for reviewing the PR.
Hi,
I'm working on a system plugin that implements onAfterApiData method to modify Joomla Web Services API response by adding Schema.org structured data.
Here's what I've confirmed:
The plugin is enabled in the Joomla admin.
The method onAfterApiData is defined in the plugin class.
I'm making GET requests and added debug logging at the beginning of the method, but the log file is never created.
It seems like the onAfterApiData method is not executed. Is there anything specific that must be one to be recognized in a system plugin?
Any help would be appreciated!
Labels |
Added:
Feature
PR-6.0-dev
Removed: PR-5.2-dev PR-5.3-dev |
Build | 5.2-dev | ⇒ | 6.0-dev |
@Sanjana2906 hi, is this PR still relevant or are you working on an alternative?
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-05-20 02:13:19 |
Closed_By | ⇒ | Sanjana2906 |
Status | Closed | ⇒ | New |
Closed_Date | 2025-05-20 02:13:19 | ⇒ | |
Closed_By | Sanjana2906 | ⇒ |
Status | New | ⇒ | Pending |
@Sanjana2906 The title of your PR starts with "[5.3]", but you have made the PR for the 5.2-dev branch.
As there will not be any further 5.2.x release, and 5.3.0 will be the next: Could you rebase your PR to the 5.3-dev branch?
If you are not sure how to do that, let me know, then I can do that.
Thanks in advance.