-
Notifications
You must be signed in to change notification settings - Fork 5
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
Sample Responses #16
Comments
Hey! I like your idea, I think we could avoid having a different Which could be useful in situations like, saving a success and errors, 401, 200, 400, things like that, what do you think? maybe something like this: #[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Request {
pub id: String,
pub method: RequestMethod,
pub uri: String,
pub headers: Option<Vec<HeaderMap>>,
pub auth_method: Option<AuthMethod>,
pub parent: Option<String>,
pub body: Option<String>,
#[serde(rename = "bodyType")]
pub body_type: Option<BodyType>,
pub responses: HashMap<u16, SampleResponse>,
} |
Nice. I feel like it makes sense to go with a I threw together a rough draft PR for this in #22 , but I'm very unfamiliar with writing TUI apps and ratatui in general so I was looking for a little more guidance on the right way to implement viewing these sample responses in the I assume that if the Secondly I assume I need to add another kind of display menu when the |
I totally agree, it makes sense to not limit by a single response per status, i'll take a look at your PR and see where I can add some comments to maybe guide you through the implementation better. As of the TUI, this can be iterated, as most of the design for HAC is a WIP and can change. I'll also try to give some guidance on how to make the sample responses editable, by having an editor there |
Feature Request
Add ability to store sample responses for requests. I'm opening this issue to get feedback on how to implement before going ahead and doing it
Motivation
it's in the TODO and I want to contribute
Proposal
A possibility would be to update the
RequestKind
like so:I was thinking that the TUI could show sample responses in the preview window. We could use some kind of icon next to preview to indicate that a sample response is available. Then the user could press a key to switch from regular
Preview
of an actual request to the sample response preview.like this, where the
*
or something could indicate a sample response is present.Alternatives
open to suggestions
The text was updated successfully, but these errors were encountered: