Open vboctor opened 1 year ago
Totally agree with that.
I'd rather have a unique id for each of the .bru
file with their ordering maintained into the bruno.json
collection file.
Reordering would impact only the collection and not the individual requests.
For what it's worth, a quick fix to point "1." would be to relax the seq
type to floating point numbers. Default assignment would continue in the same way: 1.0
, 2.0
, ... and as requests get moved around there is always free space for the new seq
, e.g. 1.5
so no other requests have to be adjusted. There can still be clashes if a file is moved into an existing folder, but I don't think that this can be helped.
However, I too think that the order should not be part of the request, as I view the request itself and its presentation as separate concerns. For the implementation of unique id:s, I see the following options:
.bru
file of the request, reference it in bruno.json
or rather a manifest in the same folder.
Not ideal. Introduces coupling between files, and user can introduce duplicate id:s by accident (e.g. moving requests between folders in the terminal)¹ Relative filepath when centrally managed in bruno.json per collection. I prefer to define the order per folder in an order
file, which keeps things local.
I'd rather have a unique id for each of the
.bru
file with their ordering maintained into thebruno.json
collection file.
I would love that too! Also, managing the sort order in the collection JSON file would allow to sort folders as well, which is currently impossible (and while alphabetical ordering is a very good default, sometimes I would prefer to manually sort by importance / frequency of use).
Where an API is positioned in a folder isn't really part of the API definition. It would be great if this can be removed from the bru file. Following are some reasons:
It would be great if there is there is a manifest file in the folder that captures folder level properties + ordering of the APIs. If an API file is manually added and is not in the manifest, then the client should add it to the end and update the manifest file.
This reduces the noise on git commits and makes the API files focus on the definition and not the view aspects like the ordering.
The manifest can be the equivalent of a collection definition file or a folder definition file.