Skip to content

[finding] os explain view's example teaches a flat view literal — ViewSchema is a CONTAINER (list / form / listViews / formViews) #15171

Description

@os-litant

Found by the catalog sweep landed for #14811, which parses every SCHEMAS entry's example in packages/cli/src/commands/explain.ts against its real schema. Rewriting catalog entries was ruled out of scope on that card (triage comment 5520209463, step 3), so this is filed unassigned for triage. Suggested domain: domain:cli.

Measured

ViewSchema (@objectstack/spec/ui) rejects the view entry's example:

[] unrecognized_keys :: Unrecognized key(s) on this view container: `type`, `layout`, `columns`.
  - `type` belongs to a single VIEW, not to the container. Wrap it:
    `defineView({ list: { type, data, columns, ... } })`, or name it —
    `defineView({ listViews: { my_view: { ... } } })`. The container's own keys
    are `list`, `form`, `listViews`, `formViews`.
  - `columns` belongs to a single VIEW, not to the container. [same guidance]

Why this one is not a typo

This is not a drifted key name — the entry teaches the wrong level. Its required / optional tables describe a single view (name, object, type, layout, columns, filters, sort) while the authorable unit ViewSchema validates is the per-object container that holds views. An operator following os explain view writes a literal that is rejected wholesale, and the spec's own error message is a better teacher than the catalog entry is.

Whoever takes this has to decide what the entry should document — the container, one view inside it, or both — which is exactly the operator-facing judgement the guard card had no mandate to make.

Reproduce

pnpm --filter @objectstack/cli exec vitest run test/commands.test.ts

The sweep names this entry as a known-broken xfail; the day the entry is corrected, that xfail turns red and is meant to be promoted to a plain assertion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions