body=`cat -`
id=`echo $body | jq -r '.id'`
#echo "id: $id, body: $body"
snippet=`curl -s --request GET --header 'Authorization: Token aaa' --header 'Content-type: application/json' --data "$body" --url "http://run.coocn.cn/api/snippets/$id"`
echo $snippet | jq '
.metadata = (.files[] | select(.name == "@metadata") | .content | fromjson) |
.files |= map(select(.name != "@metadata")) |
del(.url, .owner, .filesHash)
'
{"out":"json"}