-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
Severity 2 - Major
-
157
-
Issue Summary
When using the following API endpoint for a repo that has more than 10 deployments, the returned JSON object contains a malformed URL under the "next" field. If used as-is, the subsequent query will fail.
The url in "next" has an ampersand & instead of a question mark ? before the page query.
Steps to Reproduce
- Make an API call with that endpoint for a repo that has more than 10 deployments
- Observe the "next" URL in the output
Expected Results
The "next" URL is valid, and running an API call for it should return the next page of results.
Actual Results
The "next" URL is invalid. Instead of a question mark "?" before the page query, there is an ampersand "&":
"next": "https://api.bitbucket.org/2.0/repositories/%7B{workspace-guid}%7D/%7B\{repository-guid}%7D/deployments/&page=2&pagelen=10"
Running an API call with this returns an "HTTP 400 Bad Request" error.
Workaround
Edit the "next" URL and replace the ampersand before page with a question mark:
https://api.bitbucket.org/2.0/repositories/%7B]{workspace-guid}%7D/%7B{repository-guid}%7D/deployments/?page=2&pagelen=10