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

Allow openapi/swagger-less api configuration #183

Closed
lalmeras opened this issue Mar 20, 2023 · 1 comment
Closed

Allow openapi/swagger-less api configuration #183

lalmeras opened this issue Mar 20, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@lalmeras
Copy link
Contributor

Configuring an API alias implies that API description is managed automatically by API discovery or by explicit spec_files setting. If an API description is not available, API is unusable (failing with could not detect API type: https://api.ovh.com/1.0/).

It may be useful to allow to configure an API alias without enabling API description management. It may be helpful to manage base url or authentication settings on a description-less API.

A proposal for implementation would be:

  • base setting is used as a base URL (and can be overridden by profile)
  • operationId argument is used as a path argument, concatenated to base
  • other arguments are managed like in a classic request command

Not sure if it should need a custom attribute on api node, or if it may be a default behavior when operationId is a path (starting with /) instead of an operationId. It may allow to easily write custom request when there is a problem with API description file (missing operationId, ...).

@danielgtaylor danielgtaylor added the enhancement New feature or request label Mar 22, 2023
@danielgtaylor
Copy link
Owner

Actually this is already possible today, so I'm going to close this issue. Note that there should not be a space between the API short name and the URL path. Example:

$ restish api configure goog https://google.com
Setting up a `default` profile
? Select option for profile `default` Finished with profile
? Select option Save and exit

$ restish goog/?q=test
HTTP/2.0 200 OK
...

$ restish goog/about
HTTP/2.0 200 OK
...

Let me know if this doesn't work for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants