usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
26.7k stars 1.23k forks source link

Search also for endpoints, not just names #3349

Open Skeeve opened 1 week ago

Skeeve commented 1 week ago

I have checked the following:

Describe the feature you want to add

I usually use Bruno for testing and debugging my API. In that I need to find the endpoint. I know the url of the endpoint, but most times I do not know its summary or description. Unfortunately Bruno seems to only take care for the "name" (summary?)

  return request?.name?.toLowerCase().includes(searchText.toLowerCase());

I think it would make sense to search for the endpoint's URL as well.

Mockups or Images of the feature

image

Simply search for the url as well.

Skeeve commented 1 week ago

This is my current workaround:

perl -i -0777 -pe '
    if (m#^\s+url:\s+\{\{baseUrl\}\}(/.*)$#m) {
        my $url = $1;
        s#((\n|\A)meta\s+\{\s*\n\s+name: .*?)\n#$1 [$url]\n#s;
    }
' ./*/*.bru

In essence this searches for the url and appends it to the name. So Authenticate the user at the path /login becomes:

meta {
  name: Authenticate the user [/login]
helloanoop commented 6 days ago

Hey @Skeeve !

Thanks for bringing this up. We're currently working on enhancing the search experience, and you can expect these improvements to be available in November.

Thanks, Anoop

Skeeve commented 6 days ago

I really haven't thought about this idea, but as you store each endpoint's request file under its tags, you could as well offer to store them in a "endpoint-tree", meaning: Create a directory path for each endpoint. That way I also wouldn't have the duplication of requests if I have more than one tag for an endpoint. I have to admit that I, when I started the API 2019, misused Tags for signaling permissions a user must have in order to use that endpoint.

But these are just stupid ideas from a beginner with Bruno who might not heave fully understood yet how a pro user uses Bruno.

Currently I'm using Bruno like this:

  1. Export my full API into a Bruno Collection
  2. Test an Endpoint a bug was found for

I thought it might be great if I could export just that endpoint into a new or existing other Test-Collection.