JSON-LD validation failed - breadcrumb

Created on 25 March 2020, over 5 years ago
Updated 20 June 2023, about 2 years ago

Sorry to re-open this subject, but the two related issues (open for 7.x and seems ported to 8.x) does not correct problem

the "@graph" should be an array of objects with "@type" attributs (see screenshots in https://www.drupal.org/project/schema_metatag/issues/2979574 )

exemple with D8 site and google analyser :
https://search.google.com/structured-data/testing-tool?utm_campaign=devs...

The actual output are invalid

<script type="application/ld+json">{
    "@context": "https://schema.org",
    "@graph": [
        {
            "breadcrumb": {
                "@type": "BreadcrumbList",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://diy.bostik.com/en-UK"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Products",
                        "item": "https://diy.bostik.com/en-UK/products"
                    },
                    {
                        "@type": "ListItem",
                        "position": 3,
                        "name": "Repair \u0026 Assembly",
                        "item": "https://diy.bostik.com/en-UK/products/repair-assembly"
                    }
                ]
            }
        }
    ]
}</script>

the folowing is valid.

<script type="application/ld+json">{
    "@context": "https://schema.org",
    "@graph": [
        {
                "@type": "BreadcrumbList",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://diy.bostik.com/en-UK"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Products",
                        "item": "https://diy.bostik.com/en-UK/products"
                    },
                    {
                        "@type": "ListItem",
                        "position": 3,
                        "name": "Repair \u0026 Assembly",
                        "item": "https://diy.bostik.com/en-UK/products/repair-assembly"
                    }
                ]
            }
    ]
}</script>

Sorry reopen that.
I know that seems creating a duplicated issue, but the others are closed and problem still here.

🐛 Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

🇫🇷France DrDam

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States damienmckenna NH, USA

    Is this still a problem with v8.x-2.x or 3.0.x? The 8.x-1.x branch is no longer supported. Thank you.

  • Status changed to Needs review about 2 months ago
  • 🇸🇰Slovakia kaszarobert

    I see that this is still a problem on latest 3.0.3 version. It still generates them under a "breadcrumb" key which row shows up as an error in Schema.org Markup Validator as it is missing: @type - Unspecified Type (The @type is required and cannot be an empty string.)

    {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "NewsArticle",
                "name": "uj cikk a cimlapra",
                "headline": "uj cikk a cimlapra",
                "description": "uj cikk a cimlapra",
                "image": {
                    "@type": "ImageObject",
                    "url": "http://ma7.localhost/sites/default/files/styles/facebook_twitter_preview/public/2024-05/landscape-wallpapers-2000_0.jpg?h=ed1bbe08\u0026itok=KeTQ6LON",
                    "width": "927",
                    "height": "560"
                },
                "datePublished": "2024-05-17T14:07:39+0200",
                "isAccessibleForFree": "True",
                "dateModified": "2024-05-17T14:08:29+0200",
                "author": {
                    "@type": "Person",
                    "@id": "http://ma7.localhost/node/106",
                    "name": "ma7",
                    "url": "http://ma7.localhost/node/106"
                },
                "publisher": {
                    "@type": "Organization",
                    "@id": "http://ma7.localhost",
                    "name": "Ma7",
                    "url": "http://ma7.localhost",
                    "logo": {
                        "@type": "ImageObject",
                        "url": "http://ma7.localhost/themes/custom/mbase/images/ma7-mediacsalad.svg",
                        "width": "1000",
                        "height": "852"
                    }
                },
                "mainEntityOfPage": "http://ma7.localhost/aktualis/uj-cikk-a-cimlapra"
            },
            {
                "breadcrumb": {
                    "@type": "BreadcrumbList",
                    "itemListElement": [
                        {
                            "@type": "ListItem",
                            "position": 1,
                            "name": "Címlap",
                            "item": "http://ma7.localhost/"
                        },
                        {
                            "@type": "ListItem",
                            "position": 2,
                            "name": "Aktuális",
                            "item": "http://ma7.localhost/aktualis"
                        }
                    ]
                }
            }
        ]
    }
    

    @drdam's #2 patch does not apply to the latest version, so I rerolled it and it fixed the issue in the validator with removing the "breadcrumb" key. Please review if the approach is okay.

Production build 0.71.5 2024