-
Notifications
You must be signed in to change notification settings - Fork 4k
Disable OpenAPI "Try it" when no servers are defined #3791
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
Disable OpenAPI "Try it" when no servers are defined #3791
Conversation
🦋 Changeset detectedLatest commit: 7f6d1d7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR disables the OpenAPI "Try it" functionality when no servers are defined in the OpenAPI specification.
Key changes:
- Added a check to prevent rendering the footer when there are no servers and no multiple media types
- Added a server length check before rendering the Try It button
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/react-openapi/src/OpenAPICodeSample.tsx | Added conditional logic to hide the footer and Try It button when no servers are defined |
| .changeset/huge-worms-follow.md | Added changeset documentation for the patch |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
9fa0376 to
7f6d1d7
Compare
When no server is defined in the OpenAPI spec, clicking the Try it button causes Scalar to fall back to the R2 storage URL. This leads to requests being sent to an unintended endpoint.
To prevent this, this PR removes the Try it feature when no servers are defined in the spec.