Skip to content

Commit 2abb66b

Browse files
docs(api): catalog the /meta unrecognised-type-spelling refusal (#9245)
The `metaUrlSpellingRefusal` envelope — `INVALID_REQUEST` / 400 / "not a recognised spelling" — ships on the wire and was documented nowhere in `content/docs/**`. A caller that hit it got a status and a code it could not look up. Adds the catalog entry, plus a pointer from the Metadata API page. Measured on origin/main rather than inherited: the refusal declines a MISSPELLING of a declared type (`viewes` for `view`), not a plural — recognised plurals fold to the canonical singular and are served. The entry states no verb count, because a prose count is a declared-vs-enforced pair with no enforcement. Fixes #9193 Claude-Session: https://claude.ai/code/session_01Y26DJEHSBhhAQ6wwfsHNza Co-authored-by: Claude <noreply@anthropic.com>
1 parent ffc0d6c commit 2abb66b

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

content/docs/api/error-catalog.mdx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,62 @@ if (!res.success) showToast(res.error);
521521

522522
---
523523

524+
## Metadata API Errors (`/meta`)
525+
526+
`/meta` refusals carry codes registered to `@objectstack/metadata-protocol` in the
527+
[error-code ledger](/docs/references/api/error-code-ledger), not the standard catalog
528+
above — so their status is published here rather than inherited from a category. This
529+
section documents the **type-spelling** refusal the `/meta` request boundary raises. It
530+
is not a complete inventory of `/meta` errors.
531+
532+
### `INVALID_REQUEST` — unrecognised type spelling
533+
534+
**Cause:** The type segment of a `/meta` path is not a spelling ObjectStack recognises,
535+
*and* it evidently reaches for a metadata type the platform itself declares — a
536+
misspelling of a real type. `GET /meta/viewes` is refused because `viewes` is not a
537+
recognised spelling of the declared type `view`.
538+
539+
**Fix:** Address the type by its canonical singular name, or by its canonical REST
540+
plural. The refusal names both, so the correction never has to be guessed — for
541+
`viewes` it names `view` and `views`. See the [Metadata API](/docs/api/metadata-api).
542+
**Retry:** `no_retry` — the spelling is refused deterministically; retrying it
543+
unchanged returns the same `400`.
544+
545+
`GET /api/v1/meta/viewes` answers `400` with:
546+
547+
```json
548+
{
549+
"success": false,
550+
"error": {
551+
"code": "INVALID_REQUEST",
552+
"message": "[invalid_request] 'viewes' is not a recognised spelling of metadata type 'view'. Address it as 'view' or 'views'. Refused rather than treated as a plugin-registered type, because forwarding an unrecognised spelling of a declared type would create a second namespace under type='viewes'.",
553+
"httpStatus": 400
554+
}
555+
}
556+
```
557+
558+
<Callout type="warn">
559+
**This is not a refusal of plural type names.** Recognised plurals are *not* refused:
560+
the boundary folds them to the canonical singular and serves the request — `views`
561+
addresses `view`, `objects` addresses `object`. What this error refuses is a spelling
562+
that resolves to no type at all while reaching for one the platform declares.
563+
</Callout>
564+
565+
**Why it is refused rather than passed through.** A type segment the platform does not
566+
recognise would otherwise be treated as a plugin-registered kind, and a write under it
567+
would mint a second metadata namespace keyed by the misspelling — `type='viewes'`
568+
alongside `type='view'` — which nothing reads and nothing serves. Refusing at the
569+
boundary is what keeps one type to one key.
570+
571+
**Not this error:** a segment that reaches for no declared type — `/meta/fieldz`, or
572+
a plugin-registered kind such as `theme` — is not a misspelling of anything the platform
573+
declares, so this rule stays silent and the request continues down the plugin path. A
574+
**write** whose segment is not a metadata type at all is refused separately: same
575+
`INVALID_REQUEST` code and `400` status, different message (*"… is not a metadata
576+
type"*). Tell the two apart by the message, not the code.
577+
578+
---
579+
524580
## Error Response Structure
525581

526582
Every error response follows the `EnhancedApiError` schema:

content/docs/api/metadata-api.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Manage object schemas, metadata types, UI views, and installed packages over RES
1111

1212
Retrieve and manage object schemas, metadata types, and UI views. Always available — provided by the kernel.
1313

14+
A type segment these routes cannot recognise, but which reaches for a metadata type the
15+
platform declares, is refused `400 INVALID_REQUEST` rather than served — see
16+
[unrecognised type spelling](/docs/api/error-catalog#invalid_request--unrecognised-type-spelling)
17+
in the error catalog for the envelope and the correction it names.
18+
1419
### `GET /meta`
1520

1621
List all registered metadata types.

0 commit comments

Comments
 (0)