SR005

Severity: error

Summary: schema has more than one primary key field

What this means

Two or more fields in the schema declare primary: true. Shaperail supports exactly one primary key per resource. Composite primary keys are not supported.

Example that triggers this

resource: users
version: 1
schema:
  id:  { type: uuid, primary: true, generated: true }
  alt: { type: uuid, primary: true, generated: true }

How to fix it

Remove primary: true from all fields except one. Keep it only on the canonical id field.


Back to top

Shaperail documentation lives in the same repository as the framework so every release has versioned instructions. See the latest release for the most recent version.

This site uses Just the Docs, a documentation theme for Jekyll.