danielgtaylor / restish

Restish is a CLI for interacting with REST-ish HTTP APIs with some nice features built-in
https://rest.sh/
MIT License
717 stars 69 forks source link

Allow base path elements to be ignored #240

Open seppestas opened 5 months ago

seppestas commented 5 months ago

I use an API that uses a base with a path, e.g example.com/api/rest. This results in cli commands in the form of:

get-api-rest-foo
get-api-rest-bar-somearg-someotherarg
post-api-rest-foo
post-api-rest-bar-somearg-someotherarg

The API I use is quite verbose, with many, many arguments. As a result, some commands are ridiculously long, sometimes > 100 characters. I could off course add aliases, but I also have a stupid amount of endpoints. I tend to not need the extremely long endpoints, so I don't really want to touch them in my (auto-generated) OpenAPI spec.

It would be nice to have the option to remove the superfluous base path (api-rest-) portion from the commands.