SR062

Severity: error

Summary: relation key field not found in schema

What this means

A relation’s key: value names a field that does not exist in this resource’s schema. The key field must be declared in the schema before it can be referenced by a relation.

Example that triggers this

relations:
  org: { resource: organizations, type: belongs_to, key: missing_fk }

(without missing_fk in schema:)

How to fix it

Add the missing foreign key field to the schema:

missing_fk: { type: uuid, ref: organizations.id, required: true }

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.