New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to define possible values for query params #344
Comments
I agree with @svenluijten one key point that keep us from migration to Bruno is that our Postman documentation/examples are lost and we don't see any way to include it in Bruno. Our clients benefit from having some sort of explanation in specific params and looking at some example responses (without the need to execute the query itself). Did we miss something? |
Currently Bruno does not have this. I really like the idea. Here is how a rough idea of how we can fit this in Bruno's way of doing things. We store a the choices in the request vars using If a choice variable gets referenced inside a query param, then we should a select dropdown in the right side of the value cell. @ajaishankar Do you have any in inputs on the Bru Lang DSL ?
A bit tied with some things. If we agree on the design then I don't think any Bru Lang Transpiler updates would be needed. |
In case of documentation/params explanation, it just need to show up as a different tab, content could be in markdown. For example response, a json/xml would be enough in most cases, but I guess the same as before applies, just a new tab/area to show some markdown content. Just like Postman do, this would be great not only for Bruno's UI, but for other form of representation (like a website) |
Created a a seperate issue to track request docs here Let's continue to use this thread for discussing "choice" request params. |
I like the idea of a |
Looks like a var needs a type 😄 In the DSL we could move the types to a separate section. As long as we keep this minimal, the following could work...
In the UI we can add a type column for a var. Please see discussion on how to specify File Uploads too |
Edit: Ah wait, I think I misunderstood what you were saying @ajaishankar; you're saying the |
@svenluijten yes if we introduce a If we want to keep this inline, feel it will be better for the type annotation to go on the left hand side, like the ~ in front of the token.
In the UI think we might need a new optional column to denote the type (enum, file, file[]) etc
Or when hovering over the variable name a popover link could be clicked to edit the type. |
Keeping TOML in mindI would also consider our future plan to support TOML which currently seems to be a possibility I think, we can only look at that post v1 on a more serious level, but I'd have it in back of my mind. DSLI am almost in agreement, just running scenarios in my head if this would break anywhere vars {
message: hello
~token: secret
@disabled key: secret
@enum(start, -start, end, -end) sort : -end
@file(format=binary) img
} PS: In the future, we can consider replacing UIWe have a lot of people (>10k) using the app now, what I am seeing is that no-one actually is too concerned about the DSL. Everyone is pretty happy that the format is human readable (and would love to use a standard). Key point I am conveying is that very few people would hand-code the request on a file. If they really wanted to do that, they likely would choose a tool which is exclusively made for handcoding (https://hurl.dev/) I also never hand-code, I just use the UI. Our UI should hide this abstraction neatly. Instead of providing a third column, we should provide a special row that gets rendered differently if the user has chosen a special var/param/header/path. Next to "+ Add Var" will be dropdown icon, and then the user can choose "+ Add Enum", "+ Add File" I will put some small UI over the weekend to demo this idea. The file upload - #195 is very crucial for the community and we need to get to it sooner than later |
@conejoninja Happy to share that Bruno v0.24.0 supports request level documentation. |
For example, we support a
sort
query param in our API that can have the following values:start
-start
end
-end
It would be great if I could set the "possible values" for the
sort
query parameter in Bruno, so I don't have to go back to the code/documentation to check what options I have.The text was updated successfully, but these errors were encountered: