Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands from operationId #127

Closed
ServerlessArchitect opened this issue Jun 14, 2022 · 3 comments
Closed

Commands from operationId #127

ServerlessArchitect opened this issue Jun 14, 2022 · 3 comments
Labels
question Further information is requested

Comments

@ServerlessArchitect
Copy link

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?

@danielgtaylor
Copy link
Owner

danielgtaylor commented Jun 20, 2022

@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 danielgtaylor added the question Further information is requested label Jun 20, 2022
@ServerlessArchitect
Copy link
Author

@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?

@danielgtaylor
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants