You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proposing a standardized syntax for accessing metadata and file attributes associated with requests, folders, and collections in Bruno.
Background
Please note that Bruno supports name of the request to be different from the name of the file.
Same goes for folder name. This is in development and will be merged soon. Below is a video demo of the same
With that in mind, here is the proposed syntax for accessing request, folder and collection name.
Getting Request, Folder and Collection Name
This is stored in meta tag in bru lang and is what appears in the request name in the UI
Assume a file at /Users/john/payments-collection/folder/request.json
meta {
name: CustomRequestName
}
Property Syntax
Output
req.name
Custom Request Name
req.folderName
folder
req.collectionName
payments-collection
Method Syntax
Output
req.getName()
Custom Request Name
req.getFolderName()
folder
req.getCollectionName()
payments-collection
Getting Request File
Assume a file at /Users/john/payments-collection/folder/request.json
For me this seems reasonable, however I don't know all implications it may have.
Just to give one example:
I might have a collection containing a structure like this
SomeFolder
getItems
getItem
SomeOtherFolder
getItems
getItem
For the current implementation, if I call bru.setNextRequest("getItem") in SomeOtherFolder/getItems, it will call SomeFolder/getItem.
In my opinion, this is not the expected behavior, as I would expect to prefer requests in the current folder instead of any other ones. Because of this behavior, in the runner, this leads to an endless loop as it always jumps back and forth. This belongs to a separate bug ticket for sure (not sure if I already opened one for this) but with Folder and Request Names not being the same as the file name it could get even a bit more complicated here.
Not trying to say this is getting worse with these proposals, but at least something we should keep in mind.
Generally I am a Fan of the concept of having Request Names and File names separated, and was wondering if this could even allow same Request Names within one collection. Let's say I have two variations of the same API Endpoint I am testing, I could give them a name like setMySampleRequestData (only title) and setMySampleRequestData (all fields), but honestly, as this name would be too long to display in the sidebar anyhow, and just reduces the number of the visible tabs, I could also just name both setMySampleRequestData without a visible difference in the name and have the file names like setMySampleRequestData-1 and setMySampleRequestData-2.
This however, to return to the previous challenge makes me think if we should hand over the file names or maybe even relative file paths to functions like bru.setNextRequest in order not to run into issues like the one mentioned above.
Proposing a standardized syntax for accessing metadata and file attributes associated with requests, folders, and collections in Bruno.
Background
Please note that Bruno supports name of the request to be different from the name of the file.
Same goes for folder name. This is in development and will be merged soon. Below is a video demo of the same
request-folder-names.mp4
PR: #3094
Proposal
With that in mind, here is the proposed syntax for accessing request, folder and collection name.
Getting Request, Folder and Collection Name
This is stored in
meta
tag in bru lang and is what appears in the request name in the UIAssume a file at
/Users/john/payments-collection/folder/request.json
Getting Request File
Assume a file at
/Users/john/payments-collection/folder/request.json
Related Issues / PRs
The text was updated successfully, but these errors were encountered: