Hi, I have a use case where I have an API collection that was used for one product (Assume product A). Inside the API collections, there are finer categorization of different API calls categorized by their subpaths as follows: http://{{host}}:{{port}}/{{subpath}}
where each subpath is categorized by the folders shown in screenshot below.
Each folder in the API collection is referring to a different microservice, and they would have different subpaths, eg.
/ProductA/Auth
/ProductA/Asset
As a user, i also have a lot of other API collections for other products, so it would be best (if possible) if i do not use different API collections for different microservices, since they are all related to a single product in this case.
Hence, imo, it would be best if there’s a finer variable management at folder level as well, so that users can use Collections for storing product based APIs and Folder for storing microservices based APIs.
Thanks @wendy.cook . I just tried this and it seems to work. But i am curious if this means that if the {{FolderName}} needs to be an unique name, because you’re setting this as global variable and if I’m having the same FolderName for different Product, would the variable will be able to resolve correctly.
Alright, seems that everytime you run an API from a folder, the Pre-request scripts will always get triggered and this will overwrite the last known global {{FolderName}} variable set. This allows {{FolderName}} to be a non-unique name and can be re-used on some other collections as well.
To use a pre-request script amounts to a workaround. Why not have an actual variable set whose scope level is per-folder, in the way that is presently implemented with Globals, Workspaces, and Collections?