Close table-vs-JSON gaps in table renderers (DX-5689)#30
Merged
Conversation
…nt show' table The table view of 'qn endpoint show' only rendered six summary fields, while --format json carried the full response. Add dotted-subfield rows for is_multichain, each security feature (enabled mark + configured count), the custom IP header, and every rate-limit bucket; the tags row now always renders (— when empty). Rows for security.*/rate_limits.* are omitted when the API returns no such object. Adds tests/table_snapshots.rs: insta snapshots of real-binary stdout against a wiremock server, covering the full and minimal payloads.
…table The 'qn endpoint security show' table only listed per-feature item counts, hiding both the enabled/disabled toggles and the configured items themselves — and the security token/jwt/referrer subcommands have no list verbs, so the items had no table view at all. Render an OPTION/ENABLED table from the options toggles, then one section per non-empty item list (TOKENS, JWTS, REFERRERS, DOMAIN_MASKS, IPS, REQUEST_FILTERS) with the full item rows. Empty lists render no section, so the common single-feature config stays compact. Snapshot tests cover an all-features payload and a single-token one.
A request can return HTTP 200 while failing at the JSON-RPC layer (e.g. error_code -32601 for an unknown method). The table previously showed only the HTTP status, so such failures looked successful; the error_code field was visible only in --format json. Render it as an ERROR column after STATUS, — when absent.
The table view rendered only id, name, and default_role; the member list and pending invites were visible only in --format json. Add a members_count row plus MEMBERS and PENDING_INVITES sections (EMAIL/NAME/ROLE/STATUS), omitted when empty.
Without the status column, failed or pending payments were indistinguishable from successful ones outside --format json. Also surface the marketplace portion of each payment.
…t counts - 'usage summary' gains overages plus start_time/end_time rows so the numbers carry their window; unix seconds render as RFC-3339 via a new ParsedTime::from_unix, matching what --from/--to accept. - 'usage by-method' gains CHAIN and NETWORK columns (a method name alone is ambiguous on multi-chain accounts) and renders ARCHIVE with the standard boolean cell. - 'usage by-tag' gains the REQUESTS count.
The member-management commands take a user id, so surface it as the first column of the MEMBERS and PENDING_INVITES sections instead of leaving it JSON-only.
The dotted security.* rows only carry an enabled mark and a count; the items themselves (token values, filter methods, referrer URLs, item ids needed by the remove commands) required either --format json or a separate 'security show' call. Extract that command's item-section renderer into a shared security_item_sections helper and append the same TOKENS/JWTS/REFERRERS/DOMAIN_MASKS/IPS/REQUEST_FILTERS sections to 'endpoint show'. Empty lists still render no section.
yorsant
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The table views are hand-curated and several had fallen behind the SDK response structs — data present in
--format jsonwas invisible in the default human view. This audits everyRenderimpl against the SDK and closes the gaps. JSON output is unchanged throughout; onlyrender_tablebodies changed.endpoint show: addsis_multichain, an always-presenttagsrow,security.<feature>rows (enabled mark + configured count),security.ip_custom_header, and allrate_limits.*rows, kubectl-describe style. Rows are omitted when the API returns no security/rate-limit object.endpoint security show: rebuilt as an OPTION/ENABLED toggle table plus one section per non-empty item list (TOKENS, JWTS, REFERRERS, DOMAIN_MASKS, IPS, REQUEST_FILTERS). Previously only counts were shown — no toggles, no item detail, and thesecurity token/jwt/… subcommands have no list verbs, so configured items had no table view at all.endpoint logs: adds an ERROR column. A request can return HTTP 200 with a JSON-RPC error (e.g.-32601); the table previously showed such failures as plain 200s.team show: addsmembers_countplus MEMBERS and PENDING_INVITES sections (email/name/role/status).billing payments: adds STATUS (failed payments were indistinguishable from successful ones) and MARKETPLACE columns.usage summary: addsoveragesand RFC-3339start_time/end_timerows (newParsedTime::from_unix);usage by-method: adds CHAIN/NETWORK columns and renders ARCHIVE with the standard boolean cell;usage by-tag: adds REQUESTS.Tests
New
tests/table_snapshots.rs: insta snapshots of the real binary's stdout against wiremock fixtures — unlikeoutput_snapshots.rs(re-declared renderers), these cover the actual decode-and-render path. 11 snapshots including minimal-payload cases that pin the omission behavior.cargo test(210 tests),cargo clippy --all-targets -- -D warnings,cargo fmt --check, andcargo build --releaseall clean.