Skip to content

Conversation

@alikon
Copy link
Contributor

@alikon alikon commented Dec 2, 2025

Pull Request for Issue #43813 .

Summary of Changes

Added schema.org data handling to the endpoints of com_content, com_contact

Testing Instructions

GET {{base_path}}/api/index.php/v1/content/articles
GET {{base_path}}/api/index.php/v1/content/articles/nn
GET {{base_path}}/api/index.php/v1/contacts
GET {{base_path}}/api/index.php/v1/contacts/nn

POST {{base_path}}/api/index.php/v1/content/articles
Example payload:

{
  "alias": "my-article001",
  "articletext": "My text",
  "catid": 2,
  "language": "*",
  "metadesc": "",
  "metakey": "",
  "title": "Here's an article",
  "schema": {
    "schemaType": "Article",
    "Article": {
      "@type": "Article",
      "image": "",
      "headline": "head",
      "description": "desc",
      "author": {
        "@type": "person",
        "name": "nik",
        "url": "http://www.alikonweb.it",
        "logo": {
          "@type": "ImageObject",
          "url": ""
        },
        "email": "alikon@alikonweb.it",
        "address": {
          "@type": "PostalAddress",
          "addressLocality": "loc",
          "postalCode": "0000",
          "streetAddress": "via x"
        }
      },
      "datePublished": "",
      "dateModified": "",
      "genericField": []
    }
  }
}

PATCH {{base_path}}/api/index.php/v1/content/articles/nn
Example payload:

{
  "introtext": "My patched text with schema.org",
  "catid": 2,
  "language": "*",
  "metadesc": "",
  "metakey": "",
  "title": "Here's an article",
  "schema": {
    "schemaType": "Article",
    "Article": {
      "@type": "Article",
      "image": "",
      "headline": "head",
      "description": "desc",
      "author": {
        "@type": "person",
        "name": "nik",
        "url": "http://www.alikonweb.it",
        "logo": {
          "@type": "ImageObject",
          "url": ""
        },
        "email": "alikon@alikonweb.it",
        "address": {
          "@type": "PostalAddress",
          "addressLocality": "loc",
          "postalCode": "0090",
          "streetAddress": "via y"
        }
      },
      "datePublished": "",
      "dateModified": "",
      "genericField": []
    }
  }
}

Be aware that with PATCH you need to pass the whole schema structure if don't pass it is like you want to remove it

DELETE {{base_path}}/api/index.php/v1/content/articles/nn

POST {{base_path}}/api/index.php/v1/contacts
Example payload:

{"alias":"b-contact","catid":4,"language":"*","name":"randomFullName",
  "schema": {
    "schemaType": "Organization",
    "Organization": {
      "@type": "Organization",
      "name": "nikola",
      "image": "",
      "url": "http://www.demo.alikonweb.it",
      "email": "demo@alikonweb.it",
      "address": {
        "@type": "PostalAddress",
        "addressLocality": "roma",
        "postalCode": "00100",
        "streetAddress": "viale egeo"
      },
      "genericField": []
    }
  }
}

PATCH {{base_path}}/api/index.php/v1/contacts/nn
Example payload:

{"alias":"b-contact","catid":4,"language":"*","name":"randomFullNameetc",
  "schema": {
    "schemaType": "Organization",
    "Organization": {
      "@type": "Organization",
      "url": "http://www.demo.alikonweb.it",
      "email": "demo@alikonweb.it",
      "address": {
        "@type": "PostalAddress",
        "addressLocality": "Milan",
        "postalCode": "00100",
        "streetAddress": "viale egeo"
      },
      "genericField": []
    }
  }
}

Be aware that with PATCH you need to pass the whole schema structure if don't pass it is like you want to remove it

DELETE {{base_path}}/api/index.php/v1/contacts/nn

Actual result BEFORE applying this Pull Request

N/A

Expected result AFTER applying this Pull Request

schemaorg data returned in the response

Link to documentations

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

Added schema.org data handling to the JsonapiView.
Added schema.org data integration for contacts.
@alikon alikon marked this pull request as draft December 4, 2025 09:55
@alikon alikon changed the title [6.1] Implement schema.org data integration in JsonapiView [6.1] [webservices] Implement schema.org data integration Dec 4, 2025
@alikon alikon marked this pull request as ready for review December 4, 2025 11:29
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.

4 participants