Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-22909

Code search API filter query is incorrect

    XMLWordPrintable

Details

    Description

      Issue Summary

      Steps to Reproduce

      1. Attempt to search an individual repository for a specific phrase using the suggested filter:
        search_query=foo+repo:demo
        
      2. Execute the command and note that the results do not display properly vs. when you would perform a similar query in the UI

      Expected Results

      • The query described in the documentation is correct and can be used without any modification

      Actual Results

      • The query described in the documentation is incorrect and must be modified to yield results

      Workaround

      • By performing the code search in the UI, analysing the HTTP request made to the API reveals what query is actually required
      • Below is the actual query vs the incorrect query displayed in the API documentation:
        // API Documentation (incorrect):
        search_query=foo+repo:demo
        // Actual API Request (correct):
        search_query=repository:demo foo
        
      • With URL encoding, the URL should read as follows:
        search_query=repository%3Ademo%20foo
        

      Attachments

        Activity

          People

            Unassigned Unassigned
            57b7f67f3625 Ben
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: