Skip to content

Generated examples show JSON-array syntax for stringArray flags — sent as one literal element #51

Description

@Kevin-Chant

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions