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
Commit 5aea100
Browse filesBrowse the repository at this point in the historyBrowse files
docs(error-handling): the controlled_by_parent master-reference rows answer INVALID_METADATA for a readonly or system master
This PR changes what the two flagged declarations answer, so the two pages
that published the old 422 MISSING_REQUIRED_FIELD rows are corrected here:
the stored-null-master shape keeps MISSING_REQUIRED_FIELD (its example now
shows that message), the flagged rows answer 422 INVALID_METADATA for every
write that sets the reference, and the stale "authorable today" paragraphs,
false since the parse refuses both declarations, are removed.
Claude-Session: https://claude.ai/code/session_01LQG7z3CxDLtiMaHLbTFSeB
Co-authored-by: Claude <noreply@anthropic.com>
| 413 |`validation`|`PAYLOAD_TOO_LARGE` — an upload over the storage settings' `max_upload_mb`, or an import over its row ceiling (see [above](#payload_too_large)) |
976
-
| 422 |`validation`|`MISSING_REQUIRED_FIELD` on an absent `controlled_by_parent` master reference (see [above](#missing_required_field)) — this row is an exception to the 400 row, not a second home for the code |
981
+
| 422 |`validation`|`MISSING_REQUIRED_FIELD` on a `controlled_by_parent`detail whose stored master reference is null (see [above](#missing_required_field)) — this row is an exception to the 400 row, not a second home for the code |
Copy file name to clipboardExpand all lines: content/docs/protocol/kernel/error-handling.mdx
+36-31Lines changed: 36 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -281,7 +281,7 @@ ObjectStack uses standard HTTP status codes:
281
281
| **404** | Not Found | Resource doesn't exist |
282
282
| **409** | Conflict | Resource already exists or version mismatch |
283
283
| **413** | Content Too Large | An upload over the storage settings' `max_upload_mb`, or an import over its row ceiling — answered as [`PAYLOAD_TOO_LARGE`](/docs/api/error-catalog#payload_too_large) |
284
-
| **422** | Unprocessable Entity | Semantic validation failed (e.g. metadata spec validation); also an absent `controlled_by_parent` master reference — see [`MISSING_REQUIRED_FIELD`](#missing_required_field) |
284
+
| **422** | Unprocessable Entity | Semantic validation failed (e.g. metadata spec validation); also a `controlled_by_parent` detail whose stored master reference is null — see [`MISSING_REQUIRED_FIELD`](#missing_required_field) |
285
285
| **429** | Too Many Requests | Rate limit exceeded |
286
286
| **500** | Internal Server Error | Server-side error |
287
287
| **503** | Service Unavailable | Server overloaded or maintenance |
@@ -534,7 +534,7 @@ code is the one the *master-access gate* and the package-publish route use.
534
534
**Flat** (the 422 exception, on the `/data` door):
535
535
```json
536
536
{
537
-
"error": "[Security] Missing master reference: insert on 'invoice_line' did not supply 'invoice_id'. A controlled_by_parent detail derives its access from its master, so 'invoice_id' must carry a master record id on every write.",
537
+
"error": "[Security] Missing master reference: update on 'invoice_line' cannot be authorized because record 'line_42' has no value in 'invoice_id'. A controlled_by_parent detail derives its access from its master, so that reference must be populated.",
538
538
"code": "MISSING_REQUIRED_FIELD",
539
539
"object": "invoice_line"
540
540
}
@@ -552,24 +552,38 @@ code is the one the *master-access gate* and the package-publish route use.
552
552
```
553
553
554
554
⛔ Neither body carries a `details` bag. On the flat 422 there is no `fields` array either
555
-
— see the table below for why.
555
+
— see below for why.
556
556
557
-
**Exception — an absent `controlled_by_parent` master reference answers 422 with no `fields`.**
558
-
An object whose `sharingModel` is `controlled_by_parent` derives its access from a master
559
-
record, so the gate that authorizes writes to it must resolve that master *before* the
560
-
executor runs — and the executor is where required-field validation lives. When the master
561
-
reference is absent, whichever of the two refuses first decides the envelope, and that
562
-
depends on how the reference is declared:
557
+
**Exception — a `controlled_by_parent` detail whose stored master reference is null answers
558
+
422 with no `fields`.** An object whose `sharingModel` is `controlled_by_parent` derives its
559
+
access from a master record, so the gate that authorizes writes to it must resolve that
560
+
master *before* the executor runs — and the executor is where required-field validation
561
+
lives. An update or delete **by id** of a detail record whose *stored* master reference is
562
+
null answers `422 MISSING_REQUIRED_FIELD`, whatever the declaration, with the message
563
+
prefixed `[Security] Missing master reference:`. The caller supplied no such field, so there
564
+
is no request field to name in `fields` and no payload that would fix it.
565
+
566
+
A request that leaves the master reference out, or empties it, is answered by whichever
567
+
refuses first, and that depends on how the reference is declared:
563
568
564
569
| Master reference declared as | Refused by | Status | `code` | `fields` |
0 commit comments