curl -D- -X GET -H "Authorization: Basic --------------------=" -H
"Content-Type: application/json" https://jira.-----------.net/rest/api/latest/search?jql=assignee=wwilson
这会返回实际正确的输出,但是当我尝试通过管道传输命令对其进行格式化时,它告诉我无法解码任何 JSON 对象。
{"expand":"names,schema","startAt":0,"maxResults":50,"total":1,"issues":
[{"expand":"editmeta,renderedFields,transitions,changelog,operations","id":"11497"
,"self":"https://jira.some-company.net/rest/api/latest/issue/11497","key":"QA-
121","fields":{"summary":"Test_Run","progress":
.... Not going to give you the crapton of lines in the middle ....
{"progress":0,"total":0},"lastViewed":"2015-06-16T09:52:41.616-
0400","components":
[],"timeoriginalestimate":null,"aggregatetimespent":null}}]}
这就是当前输出的样子(部分示例,JSON 是正确的,但包含敏感信息和 -> ),但它还有 40 行左右。漂亮的印刷品将是目标。我尝试通过管道...
| python -m json.tool
但它再次抛出,即使它是一个有效的 JSON:
No JSON object could be decoded