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

API Calls Not Using Server from OpenAPI Spec #10227

Open
perusopersonale opened this issue Nov 28, 2024 · 0 comments
Open

API Calls Not Using Server from OpenAPI Spec #10227

perusopersonale opened this issue Nov 28, 2024 · 0 comments

Comments

@perusopersonale
Copy link

Environment

  • OS: Ubuntu
  • Browser: Brave (Version 1.73.89, Chromium: 131.0.6778.69)
  • Installation Method: npm
  • Swagger-UI Version: 4.18.3
  • Swagger/OpenAPI Version: OpenAPI 3.0

Issue Description

I'm integrating swagger-ui into a React app and have imported the Petstore definition. My React component looks like this:

<SwaggerUI spec={document} />

The Swagger-UI renders correctly, but when I use the "Try it out" functionality, the API calls are sent to:
http://localhost:5173/api/v3/pet

I expected these calls to point to the server defined in the OpenAPI specification from the JSON file.

I’m aware that I can use a hook to override the URL, but I was under the impression this should work out of the box.

Question:

Is this behavior expected?
Are there any solutions to address this issue other than using the hook?

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

1 participant