Skip to content
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

Feature Request: Add jq support #1584

Closed
ahochsteger opened this issue Dec 20, 2022 · 5 comments · Fixed by #1585
Closed

Feature Request: Add jq support #1584

ahochsteger opened this issue Dec 20, 2022 · 5 comments · Fixed by #1585
Milestone

Comments

@ahochsteger
Copy link
Contributor

The jq transformation language using the gojq library would be a great addition to gomplate to enable complex data processing that is often required.

Proposed Usage:

gomplate \
  -i '{{ .books | jq `[.works[]|{"title":.title,"authors":[.authors[].name],"published":.first_publish_year}]` }}' \
  -c books=https://openlibrary.org/subjects/fantasy.json
@ahochsteger ahochsteger changed the title Feature Request: Add gojq support Feature Request: Add jq support Dec 21, 2022
@hairyhenderson
Copy link
Owner

Hi @ahochsteger, thanks for filing this. I love jq, and occasionally find myself using it to pre-process data before feeding into gomplate, so this is a great idea!

@thesuperzapper
Copy link

@hairyhenderson I think your PR in #1585 did not actually add the JQ function, because however I try and use it, it seems to be missing:

  • if I try via its alias jq I get the error function "jq" not defined"
  • if I try via the coll.JQ I get the error at <coll>: can't evaluate field JQ in type interface {}"

@hairyhenderson
Copy link
Owner

@thesuperzapper what version of gomplate are you using? I don't think it made it into the 3.11.x releases...

@thesuperzapper
Copy link

@hairyhenderson ohh, I see, I was confused because I saw it on the website, I am using 3.11.5.

@hairyhenderson hairyhenderson added this to the v4.0.0 milestone Jun 25, 2023
@hairyhenderson
Copy link
Owner

@thesuperzapper yeah - it's a pain 😢... I have #1697 to track working on fixing that 😓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants