Documentation
¶
Overview ¶
Package output renders platform API responses for the CLI in the format selected by the persistent --output flag (json, yaml). Falls back to raw bytes when no typed payload matches the status code (e.g. 204).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
Render writes v in the requested format. Unknown formats fall back to JSON with a one-line stderr warning so an operator typo doesn't kill the call.
YAML output round-trips through JSON so the json tags on oapi-codegen structs propagate as YAML keys — without this the encoder uses Go field names (`AnnotationSyncVersion` → `annotationsyncversion`) which is useless for operators piping yaml back into other tools.
func RenderResponse ¶
RenderResponse extracts the typed payload from an oapi-codegen response struct (looks for JSON<status> via reflection) and writes it in the selected format. Non-2xx statuses return an error with the body content, so cobra surfaces them with exit code 1.
Types ¶
This section is empty.