Skip to content

Conversation

nolannbiron
Copy link
Member

This PR refactors OpenAPI security scopes, adds resolved scope types, improves OAuth2 handling, and updates the UI.

Copy link

linear bot commented Oct 8, 2025

Copy link

changeset-bot bot commented Oct 8, 2025

🦋 Changeset detected

Latest commit: 35b892e

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 PR enhances OpenAPI security scopes handling by refactoring type definitions and improving OAuth2 scope resolution. The changes add support for resolved scope types, better OAuth2 flow handling, and an improved UI for displaying security scopes.

  • Renamed OpenAPISecuritySchemeWithRequired to OpenAPICustomSecurityScheme and added scope resolution
  • Enhanced OAuth2 security scheme handling with proper scope merging from flows and operation requirements
  • Updated UI components to display security scopes in a more structured format

Reviewed Changes

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

Show a summary per file
File Description
packages/react-openapi/src/types.ts Renamed security scheme type and added scope type definitions
packages/react-openapi/src/resolveOpenAPIOperation.ts Added scope resolution logic for OAuth2 and other security schemes
packages/react-openapi/src/utils.ts Updated type references and improved type filtering
packages/react-openapi/src/util/tryit-prefill.ts Updated type references for consistency
packages/react-openapi/src/OpenAPISecurities.tsx Refactored OAuth2 scope display and added dedicated scope components
packages/gitbook/src/components/DocumentView/OpenAPI/style.css Extended CSS classes for scope styling
.changeset/clever-ducks-double.md Added changeset documentation

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 8, 2025

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

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 5 changed Oct 8, 2025, 10:22 PM
v2-cloudflare (Inspect) ✅ No changes detected - Oct 8, 2025, 10:26 PM
v2-vercel (Inspect) 👍 Changes approved 4 changed Oct 8, 2025, 10:24 PM

@gregberge
Copy link
Contributor

@nolannbiron where can we see a preview of it?

Copy link
Member Author

nolannbiron commented Oct 9, 2025

@nolannbiron
Copy link
Member Author

@gregberge Also wondering if we should rename “Available scopes” to “Required scopes”, makes more sense

@gregberge
Copy link
Contributor

@gregberge Also wondering if we should rename “Available scopes” to “Required scopes”, makes more sense

Required scopes is better

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