Skip to content

fix(dispatch): render scalar-array list responses as a named column - #14

Merged
phil-accelbyte merged 1 commit into
mainfrom
fix/scalar-array-list-rendering
Jun 23, 2026
Merged

phil-accelbyte merged 1 commit into
mainfrom
fix/scalar-array-list-rendering

Conversation

@phil-accelbyte

Copy link
Copy Markdown
Collaborator

Problem

A list body shaped like {"regions": ["us-east-1", ...]} — an object whose single array holds bare strings — rendered as an empty list. detect_shape unwrapped it to a bare array, then build_list_table derived columns only from object fields, found none, and returned early with zero rows. So ags ams info list-regions showed nothing, even though the data was present (the workflow dynamic-enum picker, which reads $.regions from the raw body, listed the regions fine).

Fix

Thread the unwrapped object key through ResponseShape::Array so the scalar case renders as a single column named after that key (e.g. Regions), falling back to the collection noun for bare top-level arrays. A genuinely empty array still renders as the empty-collection view.

Tests

  • An array of bare scalars renders as a single named column, not dropped.
  • End-to-end: a {"regions": [strings]} body shapes into a Collection with a single Regions column (regression guard for the empty-list bug).

A list body shaped like {"regions": ["us-east-1", ...]} — an object whose
single array holds bare strings — rendered as an empty list. detect_shape
unwrapped it to a bare array, then build_list_table derived columns only
from object fields, found none, and returned early with zero rows.

Thread the unwrapped object key through ResponseShape::Array so the scalar
case renders as a single column named after that key (e.g. "Regions"),
falling back to the collection noun for bare top-level arrays. A genuinely
empty array still renders as the empty-collection view. Fixes
`ags ams info list-regions` showing nothing.
@phil-accelbyte
phil-accelbyte merged commit 680eb3d into main Jun 23, 2026
5 checks passed
@phil-accelbyte
phil-accelbyte deleted the fix/scalar-array-list-rendering branch June 23, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant