Skip to content

Conversation

nolannbiron
Copy link
Member

This pull request addresses an issue where OpenAPI alternatives were not displaying correctly. The main change involves reordering the rendering logic for OpenAPI schema properties to prioritize showing alternatives over properties, ensuring that alternatives are visible when present.

@nolannbiron nolannbiron self-assigned this Oct 3, 2025
Copy link

linear bot commented Oct 3, 2025

Copy link

changeset-bot bot commented Oct 3, 2025

🦋 Changeset detected

Latest commit: 23e26ac

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 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 pull request fixes an issue where OpenAPI alternatives were not being displayed due to incorrect rendering priority. The main change reorders the conditional logic in the OpenAPISchema component to ensure alternatives are checked and rendered before properties.

  • Reordered rendering logic to prioritize alternatives over properties
  • Added a minor CSS adjustment for the disclosure trigger label positioning

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/react-openapi/src/OpenAPISchema.tsx Moved the properties rendering logic after alternatives to fix display priority
packages/gitbook/src/components/DocumentView/OpenAPI/style.css Adjusted right positioning for the disclosure trigger label
.changeset/unlucky-pumpkins-yawn.md Added changeset documentation for the fix

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

argos-ci bot commented Oct 3, 2025

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

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 21 changed Oct 3, 2025, 11:01 AM
v2-cloudflare (Inspect) 👍 Changes approved 21 changed Oct 3, 2025, 11:05 AM
v2-vercel (Inspect) 👍 Changes approved 6 changed Oct 3, 2025, 11:02 AM

@nolannbiron nolannbiron merged commit a4c3399 into main Oct 3, 2025
16 checks passed
@nolannbiron nolannbiron deleted the nolann/rnd-8296-openapi-not-displaying-oneof-subtypes branch October 3, 2025 11:06
clairechabas added a commit that referenced this pull request Oct 3, 2025
* main:
  Add dev script for @gitbook/expr (#3700)
  Fix OpenAPI alternatives not showing (#3699)
  RND-8165: make sure we get alt text coming through on InlineImage (#3696)
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