Bitbucket API pagination issue in code search endpoint

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • Component/s: Product - Search
    • None
    • 4
    • Severity 3 - Minor
    • 307

      Issue Summary

      Executing a GET request (2.0/teams/workspaceID/search/code?search=) or (2.0/workspace/workspaceID/search/code?search=) to fetch code search results, the pagination link for the next page swaps a '?' with an '&'. This behavior is also applicable when doing this search within the UI

      Steps to Reproduce

      Execute a GET request to

      https://api.bitbucket.org/2.0/workspaces/workspaceID/search/code?search_query=search_query
      

      Expected Results

      The pagination link in the API response correctly format query parameters, maintaining the '?' before the first parameter and using '&' only to separate additional parameters, for example

      "https://api.bitbucket.org/2.0/workspaces/workspace/search/code?search_query=test&page=2"
      

      Actual Results

      The API's response incorrectly formats the next page link by substituting '?' with '&', resulting in a malformed URL that leads to navigation errors:

      "https://api.bitbucket.org/2.0/workspaces/workspace/search/code&search_query=test&page=2"
      

      Workaround

      Copying the provided link from the response and replacing the '&' back with a '?'

            Assignee:
            Norbert Csupka
            Reporter:
            Norbert Csupka
            Votes:
            5 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: