-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Supported passing nested JSON arrays/objects to api command via fields #6614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Examples:
-f labels[]=bug -f labels[]=p1
#=> { "labels": ["bug", "p1"] }
-f branch[name]=patch-1 -F branch[protected]=true
#=> { "branch": { "name": "patch-1", "protected": true }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I would like to see this new feature syntax documented in the api command help section or perhaps in a new top level help topic.
Two discussion questions:
- Was there thoughts on adding deep nesting support, e.g
-f branch[foo[bar]]=patch-1? - What do you think about changing the array syntax to be
[]keyrather thankey[]? Perhaps I have been looking at too much Go code, but the brackets in front seem more natural to me.
|
@samcoe Thanks for the review!
Great idea! Just added with the syntax
The newest code supports interspersed nested object/array syntax, e.g.: This results in a |
Examples:
Fixes #1484