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

How do I specify the server URL in openapi.json? #120

Open
tddschn opened this issue Feb 3, 2024 · 1 comment
Open

How do I specify the server URL in openapi.json? #120

tddschn opened this issue Feb 3, 2024 · 1 comment

Comments

@tddschn
Copy link

tddschn commented Feb 3, 2024

https://cloudflare.github.io/itty-router-openapi/user-guide/router-options/

I thought OpenAPIRouter supports specifying the server URL so that the generated openapi.json will have the server URL info, but I can't find the option in the doc linked above. Is this feature supported?

@G4brym
Copy link
Member

G4brym commented Feb 3, 2024

Hey @tddschn you can pass all supported openapi properties inside the schema property of the router, here's an example for defining servers:

const router = OpenAPIRouter({
  schema: {
    servers: [{
      url: 'https://api.example.com/v1',
      description: 'example',
    }],
  },
})

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

No branches or pull requests

2 participants