-
Notifications
You must be signed in to change notification settings - Fork 494
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
feat: Add jq template function #2833
Conversation
I’m getting $ go run . execute-template '{{ dict "hello" 1 | jq "." | toJson }}'
[{"hello":1}]
$ go run . execute-template '{{ 1 | jq "." | toJson }}'
[1]⏎ EDIT: Having read the documentation, I see that’s expected. It doesn’t feel quite right to me. |
This is going to lead to very hard to read template functions:
I’m also not sure how I would embed dynamic variables given the overloading of I don’t think this is a bad addition, but I don’t know how useful it will be. |
I think that this will be more useful if we approach the jq source file as |
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.
We should be on the lookout for more complex examples to demonstrate, because the value of jq
here will be in the flexibility provided.
That's a very fair point. I'll close this PR for now. We can re-open it if it turns out that there's a good use for this functionality. |
Re-opening as @halostatue identified a possible use case in #2864 (reply in thread). Another use case is a replacement for some of the password manager functions like |
It would be nice to have this be able to call out to This might be better done as a future PR. |
Refs #2826.