restish
restish copied to clipboard
Commands from operationId
Restish generates convenient command names such as "messaging-email-address-status-get".
However, our OpenAPI spec defines operationId for all the operations. Is it possible to have Restish use those instead?
@ServerlessArchitect the name should be getting set from the operation ID, via this code: https://github.com/danielgtaylor/restish/blob/main/openapi/openapi.go#L214
Do you have a short example which exhibits the incorrect behavior that I could debug?
Edit: is the problem the normalization of kebab-casing for the command-line? Are you saying you'd rather have it use the operationId
without any sort of modification? If so, I'd consider an option for that but my preference for a default is to normalize so all the different APIs and operations are standardized.
@danielgtaylor Sorry I've taken so long to reply!
Edit: is the problem the normalization of kebab-casing for the command-line? Are you saying you'd rather have it use the operationId without any sort of modification?
That's right, but I think I'd misunderstood how it worked. I thought it was based on the URLs. Just to confirm, are you saying the command names are still based on my operationIds, just normalised?
@ServerlessArchitect
Just to confirm, are you saying the command names are still based on my operationIds, just normalised?
Yes, it is based on the operationId
if present. It is also possible to override it via x-cli-name
.