Skip to content

Conversation

@nolannbiron
Copy link
Member

@nolannbiron nolannbiron commented Nov 10, 2025

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.

@linear
Copy link

linear bot commented Nov 10, 2025

@changeset-bot
Copy link

changeset-bot bot commented Nov 10, 2025

🦋 Changeset detected

Latest commit: 7f6d1d7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@gitbook/react-openapi Patch
gitbook Patch

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

Copy link
Contributor

Copilot AI left a 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.

@argos-ci
Copy link

argos-ci bot commented Nov 10, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 34 changed Nov 10, 2025, 2:40 PM
v2-cloudflare (Inspect) 👍 Changes approved 2 changed, 2 failures Nov 10, 2025, 2:18 PM
v2-vercel (Inspect) 👍 Changes approved 8 changed, 2 failures Nov 10, 2025, 2:44 PM

@nolannbiron nolannbiron force-pushed the nolann/rnd-8542-scalar-defaults-to-storage-url-when-no-server-is-defined-in branch from 9fa0376 to 7f6d1d7 Compare November 10, 2025 14:07
@nolannbiron nolannbiron merged commit b45feaf into main Nov 10, 2025
14 of 16 checks passed
@nolannbiron nolannbiron deleted the nolann/rnd-8542-scalar-defaults-to-storage-url-when-no-server-is-defined-in branch November 10, 2025 16:25
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

Successfully merging this pull request may close these issues.

3 participants