You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jmls great question. Right now Restish is set up to have a flat list of operation commands rather than a hierarchy like you are describing. There are a few different ways you could make a hierarchy and it's not easy to do this in a generic way that would work for everyone, but I'm open to ideas!
As for using the same operation ID multiple times... see the OpenAPI spec:
Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is case-sensitive. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.
I'm not sure what nestjs is doing or recommends, but the spec says they must be unique, which is why Restish uses them as the unique command name.
Edit: also just FYI, you can provide an OpenAPI extension x-cli-name which overrides the operation name in Restish to anything you like. See here: https://rest.sh/#/openapi?id=name
if I have an openapi spec that has a number of tags (let say "foo" and "bar") then when I do a
restish myapi -h
I getyes, my operation ids are the same (using nestjs and controllers, so generated from the method name)
I was hoping to be able to do something like
restish myapi foo update
restish myapi bar update
but it seems not.
Am I forced into changing the operationIds to be fooUpdate and barUpdate ? my restish api then looks like this
which kinda looks .. sucky ;)
So in a nutshell, I 'm looking for some way of using the tags in the spec to specify a command and sub-command (tag / operratiionid)
The text was updated successfully, but these errors were encountered: