fix(cli): repeatable array flags example rendering - #26
Merged
Merged
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Route field-level, body and parameter examples through one helper so a non-repeatable array example is JSON-encoded on every path, an empty array on a repeatable flag falls through to the placeholder, and intent-command examples render one flag occurrence per element too. Execute the rendered example in the generated tests instead of retyping its flags, and cover a repeatable query parameter. Regenerate the review CLI for the quoted example values and note the quoting in the changeset.
An empty array example on a repeatable parameter rendered as a literal "[]" token in synthesized intent examples. Gate the parameter-level example with the same presence check the operation examples use so it falls through to the placeholder instead.
The repeatable-flag fragment relied on an array default to fill an empty example, but array defaults are not modeled for the CLI target, so the field rendered a placeholder and compact help blanked the whole example. Resolve the example against the per-value type: a repeatable flag over enum items takes the first enum value, matching scalar enum fields. The fragment now covers that path instead of the unsupported array default.
2ynn
force-pushed
the
fix/cli/repeatable-flags-example-rendering
branch
from
September 22, 2026 14:32
9ff688f to
03919c6
Compare
AshGodfrey
approved these changes
Sep 22, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fix generated CLI examples for repeatable string and enum array flags by emitting one flag occurrence per element. Preserve JSON encoding for other arrays, shell-quote values, and add coverage verifying the rendered command produces the correct request payload.
Fix generated CLI examples for repeatable string and enum array flags by rendering each element as a separate flag occurrence.
Before:
--labels '["release-1","release-2"]'After:
--labels release-1 --labels release-2Non-repeatable arrays continue to use a single JSON-encoded value, such as --weights '[1.5,2]'. The change also shell-quotes individual example values and adds generated CLI coverage for the rendered command and request payload.
Summary by cubic
Fixes generated CLI examples for repeatable string and enum array flags by rendering each element as a separate flag occurrence instead of a single JSON-encoded token.
--labels '["release-1","release-2"]'; after:--labels release-1 --labels release-2.<value>placeholders bare, and generated tests execute the rendered example to verify the request payload.Written for commit 03919c6. Summary will update on new commits.