Repository navigation
Supported passing nested JSON arrays/objects to api command via fields - #6614
Merged
Merged
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 }
samcoe
reviewed
Dec 5, 2022
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
|
@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 |
0x2b3bfa0
added a commit
to 0x2b3bfa0/age
that referenced
this pull request
Jan 6, 2023
FiloSottile
pushed a commit
to 0x2b3bfa0/age
that referenced
this pull request
Apr 22, 2023
This was referenced Apr 12, 2026
5 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Examples:
Fixes #1484