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

Provide example using CLI Shorthand with API short name #243

Open aaronkjones opened 3 months ago

aaronkjones commented 3 months ago

Description

I am unable to get CLI Shorthand to work when using an API short name.

For example, given the API short name example.

restish PUT example create-repo org: myorg1, repo: myrepo1, description: a nice one

Expected result

Request payload that looks like

{"org":"myorg1","repo":"myrepo1","description":"a nice one"}

Actual result

{"create-repo org":"myorg1","repo":"myrepo1","description":"a nice one"}

Environment

aaronkjones commented 3 months ago

I did find that using the j executable, piped to restish, serves my purpose.

j 'org: myorg1, repo: myrepo1, description: a nice one' | restish example create-repo