-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
coreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIa request to improve CLI
Description
Neither --field nor --raw-field accept JSON arrays right now. To pass a JSON array or a nested object, one needs to construct the JSON payload outside of gh and pass it in via --input. E.g.
jq -n '...' | gh api repos/:owner/:repo/deployments --input -I propose a new array syntax for fields:
# array of strings
-f labels[]=one labels[]=two
# empty array
-f required_contexts[]
# other value types
-F foo[]=true -F bar[]=nullThis syntax would allow passing values of any type, including an empty array, and is fully backwards-compatible. The only theoretical drawback is that it would be impossible to pass a parameter name that includes the literal [] characters, but since no API parameters ever have [] characters in their name, I think this is not a concern.
Originally posted by @mislav in #921 (comment)
vilmibm, solvaholic, benjlevesque, rjbell4, tjl2 and 29 more0x2b3bfa0 and 5tunt
Metadata
Metadata
Assignees
Labels
coreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIa request to improve CLI