Documentation
¶
Overview ¶
Package commands builds the Cobra command tree from an OpenAPI 3 spec. It handles tag-to-resource mapping, HTTP method-to-action verbs, parameter-to-flag mapping, and nested resource extraction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
Builder turns an OpenAPI 3 spec into a Cobra command tree grouped by tag, with one Cobra subcommand per operation.
func NewBuilder ¶
NewBuilder constructs a Builder from a loaded spec and a CLIRunner.
type CLIRunner ¶
type CLIRunner interface {
RunOperation(cmd *cobra.Command, method, path string, op *openapi3.Operation, sf SpecFlags) error
}
CLIRunner is the dependency-injected execution surface for leaf commands. The CLI wiring provides a concrete implementation in internal/cli that calls the HTTP executor and output formatter.
type FlagDef ¶
type FlagDef struct {
Name string
Shorthand string
Description string
Type string // "string", "bool", "int", "stringArray"
Required bool
IsBody bool
Default any
}
FlagDef is a lightweight description of a Cobra flag produced from an OpenAPI 3 operation parameter. It is used by the builder to register flags on the leaf commands.