microsoft / azure-devops-rust-api

Rust API crate for the Azure DevOps API
MIT License
60 stars 20 forks source link

Code search: Not apparent how to specify search repository and branch #469

Open suttonbradley opened 2 months ago

suttonbradley commented 2 months ago

Looking at the docs for CodeSearchRequest and the nested EntitySearchRequest and EntitySearchRequestBase, it doesn't appear that there's an option for filtering code search on target repository or branch, besides maybe the filters field on EntitySearchRequestBase, which is just an undocumented serde_json::Value.

Is it possible to get more documentation, if this filtering exists, or to have those features added if not?

johnbatty commented 1 month ago

Yeah, unfortunately the format of the filters field is not documented in the Azure DevOps documentation :-(

The only document I could find is this example code search request, which includes a filters value.

I tested specifying a target repository and branch, and got this working. I have updated the search_code example with the code to demonstrate how to do it:

I hope this helps!