Skip to content

Throw on block slugs that collide with collection or global slugs #80

Description

@janbuchar
  • 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.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions