Skip to content

Check CLI output.schema for commands with jsonTransform #1860

Closed

Description

@sentry-junior

#1854 makes buildCommand, buildListCommand, and buildDeleteCommand check output.schema against the data a command yields, but only when the output config has no jsonTransform. Commands that use jsonTransform can still document fields they don't emit, or emit them with a different type, and nothing catches it.

  • With jsonTransform, the schema describes the transform's item (what --fields operates on), not the yielded type T. For list commands, T is the ListResult envelope.
  • OutputConfig.jsonTransform is typed (data: T, fields?: string[]) => unknown (packages/cli/src/lib/formatters/output.ts), so the item type isn't visible to check the schema against.
  • In scope: the 33 command files under packages/cli/src/commands that set jsonTransform, plus the shared org-scoped list path that uses jsonTransformListResult (packages/cli/src/lib/list-command.ts).
  • Possible direction raised in the ref(cli): Type-check command yields against their output config #1854 review: type each transform's item (e.g. (data: T) => ListEnvelope<Item>) and check the schema against Item.

Follow-up to #1852 and #1854.

via @BYK.

--

View Session in Sentry

Activity

  1. linear-code commented on Nov 3, 2026

    @linear-code
  2. added a commit that references this issue on Nov 3, 2026
    79b7224
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions