Skip to content

Enable Schema.org Plugin Execution for API-saved Content in Joomla CMS. #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Sanjana2906
Copy link

@Sanjana2906 Sanjana2906 commented Apr 18, 2025

User description

Description: This PR enhances the Schema.org plugin to support execution when content is saved via the Joomla REST API. Previously, the plugin did not execute under API-based content creation or updates, limiting its functionality to administrator use cases.

Key changes in this PR:
Added support for Schema.org metadata injection during API content operations (POST, PATCH).
Ensured structured Schema.org metadata is accessible in API responses (GET).
Validated plugin behavior across both API and admin clients.
Testing Instructions:

Enable the Schema.org plugin in Joomla's backend.

Test API operations:

POST: Confirm metadata injection for new content items.
PATCH: Verify updates reflect in Schema.org metadata.
GET: Check metadata inclusion in response payloads.
Confirm consistent Schema.org metadata handling between admin UI and API.

Expected Result: Schema.org metadata is successfully applied and retrievable via both admin and API workflows, ensuring seamless integration and usa


PR Type

Documentation, Enhancement


Description

  • Added documentation for Schema.org plugin API support.

  • Detailed API endpoints for POST, PATCH, and GET operations.

  • Included testing instructions for validating API and admin workflows.

  • Highlighted expected behavior changes after the PR.


Changes walkthrough 📝

Relevant files
Documentation
schemaorg-api-support.md
Added Schema.org plugin API documentation.                             

docs/webservices/schemaorg-api-support.md

  • Added a new documentation file for Schema.org plugin API support.
  • Described API endpoints (POST, PATCH, GET) with payloads and
    responses.
  • Provided testing instructions for API and admin workflows.
  • Clarified expected results before and after the PR changes.
  • +91/-0   

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Formatting Issues

    The document contains several formatting inconsistencies and syntax errors in the markdown structure, particularly in the API endpoint documentation sections.

     **Response**
    -Status Code: `201 Created`.
    -Payload:
      ```json
      {
       "id" : 123,
       "status" : "success",
       "message" : "Schema.org created successfully."
      }
    
    Incomplete Code Blocks

    Several code blocks are not properly closed or formatted, which would cause rendering issues in the documentation.

    ```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" : "[email protected]"
        }
      }
    
    Heading Structure

    Inconsistent heading structure with improper nesting and formatting, particularly in the Results section which uses double hash but appears to be a main section.

    ##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.

    Copy link
    Contributor

    qodo-merge-pro bot commented Apr 18, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Fix incomplete code block
    Suggestion Impact:The commit added the missing closing triple backticks (```) to the JSON payload example as suggested. The commit also made additional formatting improvements to the documentation.

    code diff:

    +#### Request Payload:
    +```json
    +{
    +  "title" : "Test Article",
    +  "@type" : "Article",
    +  "articletext" : "Content",
    +  "author": {
    +     "type" : "Person",
    +     "name" : "John-doe",
    +     "email" : "[email protected]"
       }
    +}
    +```

    The JSON payload example is missing closing triple backticks (), which will
    cause incorrect rendering of the code block in the documentation.

    docs/webservices/schemaorg-api-support.md [11-22]

     ### Request Payload 
       ```json
       {
         "title" : "Test Article",
         "@type" : "Article",
         "articletext" : "Content",
         "author": {
            "type" : "Person",
            "name" : "John-doe",
            "email" : "[email protected]"
         }
       }
    +  ```

    [Suggestion has been applied]

    Suggestion importance[1-10]: 8

    __

    Why: The missing closing triple backticks would cause the code block to render incorrectly in the documentation, potentially confusing users. This is an important fix for documentation readability and correctness.

    Medium
    Fix incorrect syntax highlighting
    Suggestion Impact:The commit implemented the exact suggestion by changing the code block language specifier from 'http:' to 'http' on line 80-81 of the diff, which will fix the syntax highlighting issue

    code diff:

    -```http:
    +```http

    The HTTP example has incorrect syntax for the code block language specifier. It
    should be http without a colon, which will cause incorrect syntax highlighting.

    docs/webservices/schemaorg-api-support.md [58-59]

    -```http:
    +```http
     GET /content?type=Article&author=john-doe

    [Suggestion has been applied]

    Suggestion importance[1-10]: 7

    __

    Why: The incorrect syntax for the code block language specifier (using http: instead of http) would cause improper syntax highlighting, affecting documentation readability and professional appearance.

    Medium
    • Update

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant