MunifTanjim / node-bitbucket

Bitbucket API client for Browser and Node.js
https://bitbucketjs.netlify.app
MIT License
105 stars 31 forks source link

"sort" parameter doesn't work in "bitbucket.repositories.listDeployments()" #102

Open wwang-noggin opened 3 years ago

wwang-noggin commented 3 years ago

According to https://bitbucketjs.netlify.app/#api-repositories-repositories_listDeployments, there is a "sort" parameter. We have tested it with by calling listDeployments({ repo_slug:"repo..", workspace:"workspace", page:1, pagelen:10, sort:"last_update_time"}), the return error is: "Bad Request".

Removing the sort: "last_update_time", it works.

Node version: 14.16.0

MunifTanjim commented 2 years ago

Bitbucket's API is not consistent. According to the docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/deployments/#get paginated response should support sort. But it's possible that they don't really support it.

Does it work if you directly call the API: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/deployments/#get ?

parabolala commented 2 years ago

The sort param (nor q) is not supported in List Deployments call, per https://api.bitbucket.org/swagger.json