I am trying to post a coverage report into the reports API and getting this response
{"code": 400, "message": "Unable to process JSON"}
This is the cURL with data scrubbed. A simple data point works, so I know the API can work for me, but when the value field is the below, the API chokes. Without more logs from bitbucket, no idea why. How can I post a report like this?
curl --proxy http://localhost:29418 --request PUT http://api.bitbucket.org/2.0/repositories/<myuser>/commit/<myhash>/reports/mysystem-001 --header 'Content-Type: application/json' --data-raw '{
"title": "Coverage Report Summary",
"details": "This is the coverage report of the tests run in this pipeline",
"report_type": "COVERAGE",
"result": "FAILED",
"data": [
{
"title": "Coverage Report",
"value": "-------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------|---------|----------|---------|---------|-------------------
All files | 97.56 | 88 | 100 | 97.26 |
app | 100 | 100 | 100 | 100 |
app.config.ts | 100 | 100 | 100 | 100 |
...ounts/accounts | 100 | 100 | 100 | 100 |
....component.ts | 100 | 100 | 100 | 100 |
...tacts/contacts | 100 | 100 | 100 | 100 |
....component.ts | 100 | 100 | 100 | 100 |
app/core/services | 97.18 | 88 | 100 | 96.96 |
...er.service.ts | 100 | 100 | 100 | 100 |
loggerLevel.ts | 100 | 100 | 100 | 100 |
...le.service.ts | 93.1 | 77.77 | 100 | 92.3 | 37,56
...te.service.ts | 100 | 75 | 100 | 100 | 19
...oard/dashboard | 100 | 100 | 100 | 100 |
....component.ts | 100 | 100 | 100 | 100 |
testing | 100 | 100 | 100 | 100 |
...ing.module.ts | 100 | 100 | 100 | 100 |
testing/mock-data | 100 | 100 | 100 | 100 |
profile-photo.ts | 100 | 100 | 100 | 100 |
profile.ts | 100 | 100 | 100 | 100 |
-------------------|---------|----------|---------|---------|-------------------"
}
]
}'
I have tried "type":"TEXT" in teh data node as well, same response.