I'm trying to create a PR via the rest api (python-requests, python version 3.5), but the server keeps kicking back 'Malformed object' errors for my source and destination fields. I built the payload based on a GET for an already-existing PR, and I'm not seeing how what I'm POSTing is so different from what I GET back.
My payload looks like:
{
"source": {
"branch": {
"name": "cool-feature"
},
"commit": {
"hash": "zyx987"
},
"repository": {
"name": "awesomesauce",
"type": "repository",
"full_name": "sauce/awesomesauce"
}
},
"title": "Automatic PR: \"cool-feature\" -> \"master\"",
"destination": {
"commit": {
"hash": "abc123"
},
"branch": {
"name": "master"
}
},
"description": "Auto-PR is best PR",
"close_source_branch": false,
"type": "pullrequest"
}
POST response:
<Response [400]>
{
"error": {
"fields": {
"source": [
"malformed object"
],
"destination": [
"malformed object"
]
},
"message": "Bad request"
},
"type": "error"
}