usebruno / bruno

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

Get the folder name and the request name in a variable #3507

Open NPunzo opened 2 days ago

NPunzo commented 2 days ago

I have checked the following:

Describe the feature you want to add

This is a feature I've found in Insomnia that I loved because it allowed me to industrialize REST API testing on a very large project. The goal is to allow to get the folder name and the request name in a variable, making possible to create massively new requests really easily, just while duplicating an existing resource and renaming it.

Example of tree structure :

So, if we get into the request called "/api/v1/my/awesome/resource", the URL will be : {{baseUrl}}{{folder.name}}{{request.name}} If we look into the request named "/api/v2/my/awesome/resource", the URL will also be : {{baseUrl}}{{folder.name}}{{request.name}} And for the request named "/api//v2/my/awesome/other/resource", the URL will, again, be : {{baseUrl}}{{folder.name}}{{request.name}}

Imagine what you can do on a large project with endpoints sharing the same structure ;)

It requires also to allow slashes in the resource names. see #3266

Mockups or Images of the feature

Here is an example of how I've made it in Insomnia : image