DashboardcliformatApiResponseJson --fields envelope…

formatApiResponseJson --fields envelope filtering

Category: gotcha
Confidence: 1.00
ID: 01a02980-4059-73af-a16c-ee0130a11810
Project ID: c760f4f9-42b0-4ce0-b36d-6b8c38d770b2
Cross-project: No
Recalled in other projects: 0
Source session: 1XIG0Q84ck4K9HG1O
Created: 2026-08-21 12:40:37
Updated: 2026-08-22 12:44:26

Content

Trap: applying --fields to an API envelope looks harmless because status metadata is useful, but it prevents expected filtering of the API body and can break array-element selection. Fix: apply field filtering to response.body while preserving {status,statusText,body}; support nested dot notation and array elements without mutating the source, while retaining literal keys containing dots. Because configured jsonTransform bypasses output.ts's generic root filtering, non-envelope payloads such as --dry-run request previews must explicitly call filterFields at the root when fields are supplied.

Move to: