Documentation
¶
Overview ¶
Package bindings wires generated platform-cmd subcommands to cobra flags and JSON request bodies. Two entry points:
- DefineQueryFlags walks an oapi-codegen `*<Op>Params` struct and registers one cobra flag per field, supporting the pointer-of-scalar shape that oapi-codegen always emits for optional query parameters.
- LoadJSONBody parses a `--json-body` argument (either inline JSON or `@path/to/file.json`) into the operation's request-body struct.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefineQueryFlags ¶
DefineQueryFlags registers one flag per exported field of *params. Fields must be pointer-to-scalar (or `[]string`, or `*[]string`) — anything else is skipped silently to keep the generated --help readable. Flag names are kebab-case of the JSON tag; descriptions come from the field's Go doc comment if present.
Hidden flag policy: query params that exist only to satisfy the OpenAPI security scheme (`access_token`) are auto-hidden so operators don't think they're meant to use them — auth flows through the bearer header.
func LoadJSONBody ¶
LoadJSONBody parses `arg` into the value pointed to by dst.
- "@path/to/file.json" reads the file.
- Anything else is treated as a literal JSON string.
- Empty arg leaves dst at its zero value (useful for body-less POSTs where the server still tolerates an empty object).
Types ¶
This section is empty.