-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Support for x-enumDescriptions and x-gitbook-enum #3066
Conversation
🦋 Changeset detectedLatest commit: a7089f9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
Summary of the deployments: Version 1 (production)
Version 2 (experimental)
Test content |
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
68be02b
to
45404ae
Compare
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 adds support for x-enumDescriptions and x-gitbook-enum in the OpenAPI components, enhancing the display of enum values with optional descriptive tooltips. Key changes include:
- Implementation of a new OpenAPITooltip component to wrap enum value display.
- Updates to OpenAPISchemaEnum to prioritize x-gitbook-enum and x-enumDescriptions.
- Refactoring of OpenAPICopyButton to utilize the new tooltip component for clipboard actions.
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/react-openapi/src/OpenAPITooltip.tsx | Introduces a tooltip wrapper component for displaying additional information. |
packages/react-openapi/src/OpenAPISchema.tsx | Updates enum rendering to support x-gitbook-enum and x-enumDescriptions, and revises title inference for enums. |
packages/react-openapi/src/OpenAPICopyButton.tsx | Refactors copy button to use OpenAPITooltip for improved UX. |
packages/openapi-parser/src/types.ts | Adds types for x-enumDescriptions and x-gitbook-enum. |
.changeset/tame-colts-know.md | Records version updates and changelog for the new features. |
Files not reviewed (1)
- packages/gitbook/src/components/DocumentView/OpenAPI/style.css: Language not supported
Comments suppressed due to low confidence (1)
packages/react-openapi/src/OpenAPISchema.tsx:281
- [nitpick] Consider using a stable unique key (e.g. item.value) instead of the index to improve rendering consistency.
<span key={index} className="openapi-schema-enum-value">
d7efbba
to
c5321cf
Compare
c5321cf
to
a7089f9
Compare
DEMO
CleanShot.2025-03-28.at.21.12.42.mp4