Skip to content

Improve OpenAPIResponses examples and schemas #3123

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

Merged
merged 17 commits into from
Apr 14, 2025

Conversation

nolannbiron
Copy link
Member

@nolannbiron nolannbiron commented Apr 8, 2025

Examples with select :
CleanShot 2025-04-10 at 18 02 12@2x

Models update :
CleanShot 2025-04-10 at 17 58 18@2x

Copy link

linear bot commented Apr 8, 2025

Copy link

changeset-bot bot commented Apr 8, 2025

🦋 Changeset detected

Latest commit: cc5e842

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

@nolannbiron nolannbiron changed the title Synchronize OpenAPI responses schemas/examples Improve OpenAPIResponses examples and schemas Apr 8, 2025
Copy link

argos-ci bot commented Apr 8, 2025

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

Build Status Details Updated (UTC)
customers-v1 (Inspect) 👍 Changes approved 4 changed Apr 14, 2025, 9:02 AM
customers-v2 (Inspect) 👍 Changes approved 4 changed Apr 14, 2025, 9:03 AM
default (Inspect) 👍 Changes approved 5 changed Apr 14, 2025, 9:05 AM
v2-vercel (Inspect) 👍 Changes approved 4 changed Apr 14, 2025, 9:05 AM

@nolannbiron nolannbiron force-pushed the nolann/rnd-6447-synchronize-schemas-and-examples branch from fca8499 to f64b025 Compare April 8, 2025 20:34
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.

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

Files not reviewed (1)
  • packages/gitbook/src/components/DocumentView/OpenAPI/style.css: Language not supported
Comments suppressed due to low confidence (2)

packages/react-openapi/src/OpenAPICodeSampleInteractive.tsx:115

  • The default key for the media type sample index is set to renderer.mediaType (a string), which when converted using Number() may result in NaN. Consider using a numeric default value (e.g., '0') to reliably index renderer.examples.
const example = renderer.examples[Number(exampleState.key)] ?? renderer.examples[0];

packages/react-openapi/src/InteractiveSection.tsx:113

  • The onSelectionChange handler in the InteractiveSection component only calls state.expand() without updating the selection state via the useSelectState store. Consider invoking the store's setKey function to update the selected tab key upon selection change.
onSelectionChange={() => { state.expand(); }}

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.

2 participants