Add an example to `gh api --help` demonstrating usage of `--input`

#9104

Issue Details

about 1 year ago
No assignee
docsgh-api
williammartinwilliammartin
opened about 1 year ago
Author

Description

As mentioned in https://github.com/cli/cli/issues/8983, when it becomes challenging to use -f and -F to construct the exact JSON request body for gh api, the best option is to fallback to constructing JSON externally and to pass that via the --input flag.

https://github.com/cli/cli/issues/8983#issuecomment-2110543633 suggests that we add to the example section of gh api --help to make this more obvious, and that seems like a great idea. The code to change is here: https://github.com/cli/cli/blob/ff3a59802dfe0957fba65584551783ece554a03a/pkg/cmd/api/api.go#L126