Open fogine opened 7 years ago
@fogine sorry for late reply. Please see my feedback as follows.
Make use of
$host
&$basePath
swagger root properties.
I thought about letting users read environment variables in http-prompt. So users can do something like --auth $USERNAME:$PASSWORD
. Making use of $host
and $basePath
can conflict with environment variables. We should figure out a better design for this.
show trimmed
summary
string value in autocompletion popup
👍 for this one. Nice suggestion!
The ls command could give so much more information to a user.
This is a good feature, too! But I want ls
to behave like it was in the shell environment, so let's keep ls
the way it is now. And if users want to see more information (description and such), they could do ls -l
, just like you would do in the shell.
I don't know why, but when given the specification via --spec
flag, when I use http-prompt [domain]
I get ls
working fine, but cannot consume api because it's name-spaced under /api
, and there is a basePath: "/api"
in json spec file, however when I do http-prompt [domain]/api
then ls
and cd
stop working. What might be the problem?
I seem to have the same problem as @branquito. The swagger integration does not respect the basePath
of the swagger spec correctly. It would be great if this could be improved.
@branquito @my-flow the basePath
issue has been fixed in v0.11.2.
Can the input for OpenAPI specs be specified in YAML format rather than JSON/ Also, what version is supported (OpenAPI 3, I hope!)
Can the input for OpenAPI specs be specified in YAML format rather than JSON/ Also, what version is supported (OpenAPI 3, I hope!)
Hi,
Is there any way to show the schema of the body (for POST calls) when exploring the OpenAPI spec through this feature? I've looked through the documentation but can't seem to find any information about it.
Thanks.
@eliangcs , Thank you for your good job with initial integration with
swagger
specs. I had time to putswagger
feature into practice and think there could be made several improvements which would increase overall usability as swagger specifications contain much more information that could be displayed to an user.The following are general ideas how we could improve swagger integration.
Make use of
host
&basePath
swagger root properties. Basically callhttp://localhost:8000> cd $host + $basePath
by default .Autocompletion of
ls
&cd
cmds is quite handy as it is. However, the "Endpoint" static value is currently showed everywhere no matter whether current path is an actual endpoint or just part of one or more endpoints. Furthermore, useful would be to show trimmedsummary
string value in autocompletion popup when we want to initiate the request. Consider the following example:When I type the request method (post), I'd get "Creates new app" instead of current "POST request" autocompletion value. Also we could show autocompletion of url segments in case of inline endpoint definition: Example:
while typing the "fogine/apps" path segment, it'd show autocompletion of possible url segments and for the last url segment (apps) I could get completion value of "Creates new app" string. I think this would really improve user experience although I haven't considered possible implementation issues so far.
ls
command could give so much more information to an user. Consider the following list of endpoints that web service implements:/users/{username}
/users/{username}
/users/{username}/avatar
Now in http-prompt I'd just show the data:
Here, sample endpoints are rather simple but for more complicated routes, the
summary
and possible request methods of given endpoint provide very useful info. There is more information to show like endpoint tags, operationId. Table heading and columns could be configurable...ls
command could also work withoperationId
swagger option as an endpoint which implements more than one request method can't uniquely identify itself. When an user wouldls
an actual endpoint, eg:we could display detailed endpoint information, like route
description
, response http codes, for request parameters - parameter type, information about whether a parameter is required or not etc...To conclude where I'm heading with this, the idea is to be able to use
http-prompt
with swagger specs without a need for actually looking for information elsewhere like now it's required for more complicated web services.Note: I haven't thought much about the actual data output formats, so that should be thought out. What do you think @eliangcs or anybody else?