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

Handle variable OpenAPI server urls #1131

Open
johanohly opened this issue Nov 30, 2024 · 0 comments
Open

Handle variable OpenAPI server urls #1131

johanohly opened this issue Nov 30, 2024 · 0 comments
Labels
enhancement New feature or request PR welcome Feature Request approved

Comments

@johanohly
Copy link

What problem will this feature address?

I am currently rewriting the docs of my self-hostable app, which means that the API url that is used differs from user to user. It would be pretty cool if the server url could be customizable by the end user, and it is actually part of the openapi spec: https://swagger.io/docs/specification/v3_0/api-host-and-base-path/#

Describe the solution you'd like

Show an input when the server url is set to variable, so the user needs to set their own URL to be able to test the endpoints.

Describe alternatives you've considered

Not having a server URL but that would be a shame, as the interactive playground would be awesome.

Additional context

Definition:

servers:
  - url: '{protocol}://{fqdn}/api'
    description: 'The API is running at `/api` of your AirTrail instance.'
    variables:
      protocol:
        enum:
          - 'http'
          - 'https'
        default: 'https'
      fqdn:
        default: 'airtrail.example.com'

Swagger Editor example:
image

(I don't necessarily need the variables, one input with the whole base url would be awesome as well)

@johanohly johanohly added the enhancement New feature or request label Nov 30, 2024
@fuma-nama fuma-nama added the PR welcome Feature Request approved label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR welcome Feature Request approved
Projects
None yet
Development

No branches or pull requests

2 participants