• Resolved bbengineroom

    (@bbengineroom)


    The SEO Framework is outputting itemListElement as a plain object {} instead of an array [] when there’s only one breadcrumb level (such as on the homepage). This creates invalid JSON-LD that fails validation.

    Current output (invalid):

    “breadcrumb”: {
    “@type”: “BreadcrumbList”,
    “@id”: “https://haletrailer.com/#/schema/BreadcrumbList”,
    “itemListElement”: {
    “@type”: “ListItem”,
    “position”: 1,
    “name”: “Hale Trailer”
    }
    }

    Expected output (valid):

    “breadcrumb”: {
    “@type”: “BreadcrumbList”,
    “@id”: “https://haletrailer.com/#/schema/BreadcrumbList”,
    “itemListElement”: [{
    “@type”: “ListItem”,
    “position”: 1,
    “name”: “Hale Trailer”
    }]
    }

    Per schema.org spec: itemListElement is defined as an array (ListItem or Text). Even with a single item, it must be wrapped in array brackets [].

    To reproduce:

    1. View source on any page with a single breadcrumb level (e.g., homepage)
    2. Check the BreadcrumbList JSON-LD output
    3. Validate with Google Rich Results Test or schema.org validator

    Validation error: Google Rich Results Test flags this as “Invalid JSON-LD syntax” and schema validators report “itemListElement should be an array.”

    Impact: While Google’s parser may be forgiving, this produces technically invalid schema that fails validation tools and could affect proper interpretation by search engines.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    Thank you for the detailed report.

    Both forms are valid JSON-LD. The JSON-LD 1.1 specification defines that the expanded document form always wraps property values in arrays, while the compacted form simplifies single-element arrays to their value. Both produce identical RDF graphs, making them semantically equivalent.

    Generally, when compacting, properties having only one value are represented as strings or maps, while properties having multiple values are represented as an array of strings or maps. — § 5.2.7 Representing Singular Values as Arrays

    The single-element unwrapping is intentional — TSF’s bespoke Arrays::scrub() method cleans up the Schema.org graph by simplifying single-item lists into their value. This keeps the output compact without altering its meaning.

    If you’re seeing validation errors, the tool may be applying stricter rules than the spec requires. Google’s Rich Results Test should accept both forms without issue.

    Addendum: I just tested the output you described using Google’s Rich Results Test, and it reported no markup errors.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.