From a8657187d28c1346e9489f40f4a81745a2467c79 Mon Sep 17 00:00:00 2001 From: Sanjana2906 Date: Fri, 18 Apr 2025 17:28:41 +0530 Subject: [PATCH 1/3] Add initial Schema.org API support documentation with testing instructions --- docs/webservices/schemaorg-api-support.md | 91 +++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 docs/webservices/schemaorg-api-support.md diff --git a/docs/webservices/schemaorg-api-support.md b/docs/webservices/schemaorg-api-support.md new file mode 100644 index 00000000..3f8b98f8 --- /dev/null +++ b/docs/webservices/schemaorg-api-support.md @@ -0,0 +1,91 @@ +# Schema.org Plugin API Documentation + +## Introduction +This document provides details about the Schema.org system plugin's API support in Joomla CMS. This guide outlines the API endpoints, payload structure, and testing instructions. + +--- + +### POST /content +Creates a new content item with Schema.org metadata. + +### Request Payload + ```json + { + "title" : "Test Article", + "@type" : "Article", + "articletext" : "Content", + "author": { + "type" : "Person", + "name" : "John-doe", + "email" : "john@example.com" + } + } + + **Response** +-Status Code: `201 Created`. +-Payload: + ```json + { + "id" : 123, + "status" : "success", + "message" : "Schema.org created successfully." + } + + +### PATCH /content/{id} +Updates an existing content item with Schema.org metadata. + ```json + { + "author": { + "type" : "Person2", + "email" : "person2@example.com" + } + } + +**Response** +-Status Code: `200 OK` or `204 No Content`. + + +```markdown +### GET /content +Retrieves content items with Schema.org metadata. + +####Query parameters: +- `type` : Filter by type (e.g., Article, Person). +- `author` : Filter by author name. + +#### Example: +```http: +GET /content?type=Article&author=john-doe + +**Responses** +-Status Code :`200 OK`. + ```json + { + "id" : 123, + "title" : "Test Article", + "@type" : "Article", + "author" : { + "type" : "Person", + "name" :"John-doe", + "email" : "john@example.com" + } + } + + +#### Testing Instructions +```markdown +1. Enable the Schema.org plugin in Joomla's backend. +2. Use Joomla REST API to + - **POST** : Creates new content. + - **PATCH**: Update existing content. + - **GET** : Verify structured metadata is included in the response. +3. Ensure that schema metadata appears in both API and administrator use cases. + +##Results + +## Actual result Before PR +- Schema.org plugin does not execute when content is saved via API. + +## Expected Result After PR +- Schema.org plugin supports execution via both admin and API clients, enabling full metadata injection. \ No newline at end of file From b85696b481b204267ef28e17e6376360f4d9d320 Mon Sep 17 00:00:00 2001 From: Sanjana2906 Date: Fri, 18 Apr 2025 18:55:41 +0530 Subject: [PATCH 2/3] Refined documentation and formatting improvements --- docs/webservices/schemaorg-api-support.md | 71 ++++++++++++----------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/docs/webservices/schemaorg-api-support.md b/docs/webservices/schemaorg-api-support.md index 3f8b98f8..e9bde8f3 100644 --- a/docs/webservices/schemaorg-api-support.md +++ b/docs/webservices/schemaorg-api-support.md @@ -5,31 +5,34 @@ This document provides details about the Schema.org system plugin's API support --- + ### POST /content Creates a new content item with Schema.org metadata. -### Request Payload - ```json - { - "title" : "Test Article", - "@type" : "Article", - "articletext" : "Content", - "author": { - "type" : "Person", - "name" : "John-doe", - "email" : "john@example.com" - } +#### Request Payload: +```json +{ + "title" : "Test Article", + "@type" : "Article", + "articletext" : "Content", + "author": { + "type" : "Person", + "name" : "John-doe", + "email" : "john@example.com" } +} +``` - **Response** --Status Code: `201 Created`. --Payload: - ```json - { - "id" : 123, - "status" : "success", - "message" : "Schema.org created successfully." - } +**Response** +- Status Code: `201 Created`. +- Payload: +```json +{ + "id" : 123, + "status" : "success", + "message" : "Schema.org created successfully." +} +``` ### PATCH /content/{id} @@ -41,25 +44,27 @@ Updates an existing content item with Schema.org metadata. "email" : "person2@example.com" } } + ``` **Response** --Status Code: `200 OK` or `204 No Content`. +- Status Code: `200 OK` or `204 No Content`. -```markdown ### GET /content Retrieves content items with Schema.org metadata. -####Query parameters: -- `type` : Filter by type (e.g., Article, Person). -- `author` : Filter by author name. +#### Query parameters: +- `type`: Filter by type (e.g., `Article`, `Person`). +- `author`: Filter by author name. + #### Example: -```http: +```http GET /content?type=Article&author=john-doe +``` **Responses** --Status Code :`200 OK`. +- Status Code :`200 OK`. ```json { "id" : 123, @@ -71,10 +76,10 @@ GET /content?type=Article&author=john-doe "email" : "john@example.com" } } + ``` #### Testing Instructions -```markdown 1. Enable the Schema.org plugin in Joomla's backend. 2. Use Joomla REST API to - **POST** : Creates new content. @@ -82,10 +87,10 @@ GET /content?type=Article&author=john-doe - **GET** : Verify structured metadata is included in the response. 3. Ensure that schema metadata appears in both API and administrator use cases. -##Results +## Results -## Actual result Before PR -- Schema.org plugin does not execute when content is saved via API. +### Actual Result Before PR +-Schema.org plugin does not execute when content is saved via API. -## Expected Result After PR -- Schema.org plugin supports execution via both admin and API clients, enabling full metadata injection. \ No newline at end of file +### Expected Result After PR +-Schema.org plugin supports execution via both admin and API clients, enabling full metadata injection. \ No newline at end of file From 766e887860361da68aaaae0e8e48e9f93f271797 Mon Sep 17 00:00:00 2001 From: Sanjana2906 Date: Fri, 18 Apr 2025 21:50:26 +0530 Subject: [PATCH 3/3] Refined documentation and formatting improvements. --- docs/webservices/schemaorg-api-support.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/webservices/schemaorg-api-support.md b/docs/webservices/schemaorg-api-support.md index e9bde8f3..9948d41c 100644 --- a/docs/webservices/schemaorg-api-support.md +++ b/docs/webservices/schemaorg-api-support.md @@ -1,10 +1,17 @@ + +--- +id: schemaorg-api-support +title: Schema.org Plugin API Documentation +description: Guide for using the Schema.org plugin via Joomla REST API +slug: /webservices/schemaorg-api-support +--- + + # Schema.org Plugin API Documentation ## Introduction This document provides details about the Schema.org system plugin's API support in Joomla CMS. This guide outlines the API endpoints, payload structure, and testing instructions. ---- - ### POST /content Creates a new content item with Schema.org metadata. @@ -35,7 +42,7 @@ Creates a new content item with Schema.org metadata. ``` -### PATCH /content/{id} +### PATCH `/content/{id}` Updates an existing content item with Schema.org metadata. ```json {