Skip to content
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

Any plan to support JetBrains HTTP file format? #122

Closed
linux-china opened this issue Mar 19, 2024 · 4 comments
Closed

Any plan to support JetBrains HTTP file format? #122

linux-china opened this issue Mar 19, 2024 · 4 comments
Labels
feature New behavior to enable things that were previously not possible help wanted Extra attention is needed

Comments

@linux-china
Copy link

I found that Slumber and JetBrains HTTP file share most concepts, such as profile/environment, recipes/targets etc. Yes, slumber.yml is good to write http requests, but http file is better DSL in http. VS code has http file support too.

Could Slumber add support for JetBrains http file?

@LucasPickering
Copy link
Owner

It'd be possible to add this as an import target, similar to Insomnia. You would run a command once to generate a Slumber collection based on your HTTP file. It requires more work than Insomnia though because we would need a parser for this HTTP format. It looks like there's a library for it in Rust called http-rest-file but I'm not sure if it will actually work, it doesn't look very polished.

@LucasPickering LucasPickering added the feature New behavior to enable things that were previously not possible label Mar 19, 2024
@benfaerber
Copy link
Contributor

benfaerber commented Apr 26, 2024

@LucasPickering I'm working on this, here's my fork: https://github.com/benfaerber/slumber/tree/add-http-file-support

I'm planning on using nom to parse the basic format and then httparse to parse the actual request portion. I think this is better because httparse is a very popular crate and the rest of the format is pretty simple to implement (just separators and variables)

Let me know if I should know anything before going further.

@LucasPickering
Copy link
Owner

@benfaerber Thanks for taking this on! As far as guidance, the main thing is just copy the boilerplate from Insomnia. Aside from that:

  • Your approach sounds good, httparse is already in the dependency tree via hyper so just make sure we don't end up with duplicate versions (cargo-tree is nice for that)
  • Make sure to update the docs in import.md when you're done
  • I would call use the name jetbrains instead of just http in the module/file naming. It's more specific, even if Jetbrains just calls it the "HTTP format"

@LucasPickering
Copy link
Owner

This is closed now, will ship in 2.5.0. Thanks to @benfaerber!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New behavior to enable things that were previously not possible help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants