Generated examples show JSON-array syntax for stringArray flags — sent as one literal element
- Dominant language
- Go
- Stars
- 1
- Forks
- 0
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 18
Description
**Behavior:** generated `--help` examples and docs show stringArray flags as a JSON array literal (`--guardrail-metric-ids '["fact__a","fact__b"]'`), but cobra StringArray passes the value verbatim — the request body gets ONE element containing the JSON text. The server may accept and store it (verified: a garbage metric id persisted with exit 0) — silent data corruption from following the CLI's own docs. ~11 generated examples use this style; correct usage is repeated flags.
**Carried fix:** `.speakeasy/patches/internal/flagutil/metadata.go.patch` (PR #48) — a single value that parses as a JSON string array is expanded into its elements, making the documented syntax work and `[]` expressible. Repeated-flag form is unchanged.
**Retire when:** Speakeasy's example generator emits repeated-flag syntax for stringArray flags (or the framework natively accepts JSON arrays).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with .speakeasy/patches/internal/flagutil/metadata.go.patch and compare its behavior with the generated --help examples for stringArray flags. Verify that JSON-array input expands into elements, repeated flags remain unchanged, and [] remains expressible; retire the issue when the generator uses repeated-flag syntax or the framework natively accepts JSON arrays.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100