Skip to content

v1.3.0

Latest

Choose a tag to compare

@6f5 6f5 released this 01 Mar 00:06

What's New

Full @id cross-reference support across all schema types

All reference fields now accept { "@id": "..." } objects for @graph cross-referencing via SchemaIds. Previously only author and publisher (via PersonOrOrgRef) supported this — now every field that references another schema type does.

const ids = new SchemaIds('https://example.com');

const graph = createGraph([
  createOrganization({ '@id': ids.organization(), name: 'Acme', url: 'https://example.com' }),
  createWebSite({ '@id': ids.website(), publisher: ids.ref('organization') }),
  createWebPage({ isPartOf: ids.ref('website'), breadcrumb: ids.ref('breadcrumb') }),
  createArticle({ publisher: ids.ref('organization'), mainEntityOfPage: ids.ref('webpage') }),
]);

Fields updated (30+):

Category Fields
Thing subjectOf, mainEntityOfPage
Event location, subEvent, superEvent
Organization subOrganization, parentOrganization
Place containedInPlace
LocalBusiness department
CreativeWork isPartOf
WebPage breadcrumb, mainContentOfPage, primaryImageOfPage
WebSite isPartOf
Article/BlogPosting sharedContent
Book publisher, aggregateRating
ProfilePage mainEntity, hasPart
Quiz about
JobPosting hiringOrganization
DiscussionForum sharedContent, mainEntityOfPage
Offer seller, hasMerchantReturnPolicy
Review itemReviewed
EmployerAggregateRating itemReviewed

Bug fixes

  • Fixed deprecated .passthrough() → .catchall(z.unknown()) in Article.ts and Rating.ts (Zod v4)
  • Added RealEstateListing example to custom extensions guide