Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
Severity 3 - Minor
-
43
-
1
-
Description
Issue Summary
- The filter query that is described in the API documentation is out-of-date and produces no results - specifically when attempting to search an individual repository for a specific phrase:
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-other-operations/#api-workspaces-workspace-search-code-get
Steps to Reproduce
- Attempt to search an individual repository for a specific phrase using the suggested filter:
search_query=foo+repo:demo
- 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