Skip to content

[finding] os explain object's example does not parse as an Object — field.options is documented and sampled as string[], the spec wants objects #15170

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

ObjectSchema (@objectstack/spec/data) rejects the object entry's example:

[fields.status.options.0] invalid_type :: Invalid input: expected object, received string
[fields.status.options.1] invalid_type :: Invalid input: expected object, received string

The sample writes status: { type: 'select', label: 'Status', options: ['open', 'closed'] }.

Second surface, same root cause

The field entry's own optional-property table documents the same key with the same wrong type:

  • { name: 'options', type: 'string[]', description: 'Available choices (select fields)' }

That row is prose, not a parsed literal, so the sweep does not turn it red — but it teaches operators the shape that the object example then demonstrates and the spec then rejects. Whoever fixes the example should fix the row in the same pass, and the field entry's example (which parses today) is a candidate place to demonstrate the real option shape.

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