Property `size` missing in `/2.0/repositories/{team}/{repo}/refs/branches` API response

Issue #16993 open
Ronald Rey
created an issue


I'm the author and maintainer of the Refined Bitbucket browser extension, which for one of its features it's hitting the endpoint mentioned in the title and relying on the .size property to show a badge with the number of open branches in the sidebar.


About three days ago, the feature broke because the .size property is not being returned anymore. I checked the documentation in the link below and the property is still documented, which leads me to believe that maybe this was a mistake?

Also, as you can see from the picture, the pull-requests API endpoint which has a similarly-shaped response wasn't affected.

Can anyone confirm what happened here? I have about 4,500+ active users in the extension that are seeing this bug at the moment and I would prefer not to have to rollback the feature :(


Comments (8)

  1. Erik van Zijst

    The branches (and tags) endpoint was recently improved to take into account natural sorting of numerical values. Looking at that change, it seems that that had the side effect of removing the size element. This was not intentional and I will look into adding that back.

    As a related note though, not all collection endpoints on Bitbucket include a size element. This is generally for performance reasons, as it doesn't always scale well to commit to computing the total size of a data set. This was the case for refs as well and so in general clients should not expect every endpoint to have that element.

    Having said that, we should not be breaking existing endpoints.

  2. Ronald Rey reporter

    Hello Erik, that's great, thank you for looking into it!

    I agree with everything you said. I can't speak for all clients, but for me personally, I would only use properties that are documented, so as long as those collection endpoints are properly documented I think there will be no issue.

  3. Log in to comment