-
Notifications
You must be signed in to change notification settings - Fork 36
JSON checker
Filippe LeMarchand edited this page Feb 20, 2021
·
1 revision
The JSON checker allows using jq to query JSON data with arbitrary schema to get version and download url.
To use the JSONChecker, specify JSON data URL, version query and url query
(you can use $version
variable got from the version query in url query):
{
"type": "json",
"url": "https://api.github.com/repos/stedolan/jq/releases/latest",
"version-query": ".tag_name | sub(\"^jq-\"; \"\")",
"url-query": ".assets[] | select(.name==\"jq-\" + $version + \".tar.gz\") | .browser_download_url"
}
for git type sources, specify tag query and, optionaly, commit and version queries:
{
"type": "json",
"url": "https://api.github.com/repos/stedolan/jq/releases/latest",
"tag-query": ".tag_name",
"version-query": "$tag | sub(\"^jq-\"; \"\")"
}
See the jq manual for complete information about writing queries.