Skip to content

schema/json-ld-valid: validator still stricter than schema.org/Google (arrays, AggregateOffer, publisher) #469

Closed

Description

@nc9

Found while fixing #463. packages/parser/src/schema/validator.ts, the validator behind schema/json-ld-valid, is stricter than schema.org or Google in a few more places. Each one yields a false positive on valid markup:

  • Single values where it wants arrays. In JSON-LD any property may hold one value or an array. Recipe.recipeIngredient and Recipe.recipeInstructions are typed array, so a single string (which Google accepts for recipeInstructions) reports must be an array. FAQPage.mainEntity and BreadcrumbList.itemListElement behave the same way for a single object.
  • AggregateOffer. Product.offers requires price, priceCurrency and availability on every offer. An AggregateOffer carries lowPrice / highPrice instead of price, so it reports Product.offers.price is required.
  • Article.publisher (and publisher.logo) are required. Google's Article documentation lists no required properties, and publisher is not among the recommended ones. A Person publisher has no logo at all.
  • Untyped top-level @graph nodes are not indexed for @id resolution. extractSchemas keeps only nodes with an @type, so a reference to {"@id":"#p","name":"..."} with no @type is checked as written.
  • Separately, the item checks on BreadcrumbList list items and the name/acceptedAnswer checks on FAQPage questions never run: validatePropertyType returns before the array/item branch because rule.required is unset at that level. Fixing that adds findings, so it needs the "last breadcrumb needs no item" exemption Google documents.

Acceptance Criteria

  • recipeIngredient / recipeInstructions given as a single string, and mainEntity given as a single Question, are not reported as invalid
  • A Product whose offers is an AggregateOffer with lowPrice and priceCurrency reports no offers.price issue
  • An Article without publisher, or with a Person publisher that has no logo, reports no publisher / publisher.logo issue (or the rule's docs justify keeping it)
  • A bare {"@id"} reference to an untyped top-level node on the same page resolves
  • BreadcrumbList item checks either run (with the last item exempt from item) or the dead branch is removed
  • docs/rules/schema/json-ld-valid.mdx matches the new behaviour

Activity

  1. added
    bug
    P3
    size: S
    rules
    on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3bugrulessize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions