You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Throw on block slugs that collide with collection or global slugs #80
adjustRefTargets resolves #/definitions/<slug> by trying collections, then globals, then blocks. Payload puts all three in one namespace, so a config-level block sharing a slug with a collection silently resolves to the collection schema.
Repro: collection pages with labels: { singular: 'Sheet' } plus a config-level block pages referenced through blockReferences — the blocks array is documented as oneOf: [$ref Sheet], i.e. as holding collection documents. Predates feat: Add blockReferences support #60; that PR only adds an orphaned Pages schema next to the same wrong ref.
Nothing in the ref distinguishes a block from a collection, so the fix is to refuse the config rather than guess — same treatment defineSchemas gives colliding component names.
adjustRefTargetsresolves#/definitions/<slug>by trying collections, then globals, then blocks. Payload puts all three in one namespace, so a config-level block sharing a slug with a collection silently resolves to the collection schema.pageswithlabels: { singular: 'Sheet' }plus a config-level blockpagesreferenced throughblockReferences— the blocks array is documented asoneOf: [$ref Sheet], i.e. as holding collection documents. Predates feat: Add blockReferences support #60; that PR only adds an orphanedPagesschema next to the same wrong ref.defineSchemasgives colliding component names.