Skip to content

Conversation

@nolannbiron
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Nov 19, 2025

🦋 Changeset detected

Latest commit: 675d8da

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

This PR includes changesets to release 3 packages
Name Type
@gitbook/openapi-parser Patch
@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

@argos-ci
Copy link

argos-ci bot commented Nov 19, 2025

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

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 46 changed Nov 21, 2025, 5:50 PM
v2-cloudflare (Inspect) 👍 Changes approved 7 changed Nov 21, 2025, 5:55 PM
v2-vercel (Inspect) 👍 Changes approved 7 changed Nov 21, 2025, 5:54 PM

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 adds support for two new OpenAPI extension properties (x-prefix and x-placeholder) to customize security scheme behavior in code samples. The changes allow API documentation authors to override default prefix values (like "Bearer", "Basic") and placeholder text for authentication tokens.

Key Changes

  • Added x-placeholder property to override default placeholder values in security schemes
  • Added x-prefix property to customize authentication prefixes (e.g., custom alternatives to "Bearer" or "Basic")
  • Updated security header generation logic to check for and apply these custom properties across HTTP, apiKey, and OAuth2 security schemes

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/openapi-parser/src/types.ts Defines TypeScript interfaces for the new x-placeholder and x-prefix extension properties
packages/react-openapi/src/util/tryit-prefill.ts Adds fallback logic to use x-placeholder when x-gitbook-prefill is not present
packages/react-openapi/src/util/tryit-prefill.test.ts Tests prioritization of x-gitbook-prefill over x-placeholder and validates x-placeholder for apiKey schemes
packages/react-openapi/src/OpenAPICodeSample.tsx Implements x-prefix support across HTTP, apiKey, and OAuth2 security types; exports getSecurityHeaders for testing
packages/react-openapi/src/OpenAPICodeSample.test.ts New test file covering x-prefix functionality with apiKey schemes and combined x-prefix/x-placeholder usage
.changeset/five-worlds-kneel.md Documents the changes for both affected packages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nolannbiron nolannbiron force-pushed the nolann/add-x-prefix-to-securities branch from d24d597 to 675d8da Compare November 21, 2025 17:44
@nolannbiron nolannbiron merged commit 461e15f into main Nov 22, 2025
16 checks passed
@nolannbiron nolannbiron deleted the nolann/add-x-prefix-to-securities branch November 22, 2025 09:44
clairechabas added a commit that referenced this pull request Dec 3, 2025
…ption

* main: (45 commits)
  Remove corner radius of hint block with heading (#3839)
  Make semantic text colors more vibrant (#3838)
  Fix hidden section not found (#3836)
  Update AIChat context card open delay (#3834)
  Support for hidden sections (#3831)
  Make annotations visible on hover, fix accessibility and outro animations (#3822)
  Replace AI Chat generated content in e2e (#3833)
  Remove sticky prop on Updates block (#3832)
  Stop filtering by language when site space language is unspecified (#3825)
  Fix flaky tests in AI Chat greeting (#3828)
  Add RSS feed for pages with update blocks (#3824)
  Prevent flaky tests in AI Chat followup suggestions (#3827)
  Update wranglerVersion to 4.43.0 (#3826)
  Update Assistant e2e tests (#3814)
  Update Assistant styling (#3797)
  Add `x-gitbook-prefix` and `x-gitbook-token-placeholder` for OpenAPI security scheme (#3820)
  Add 'use server' directive to markdown renderer (#3815)
  Improve OpenAPI circular references (#3821)
  Fix links to other spaces in embeddable view (#3819)
  Optimise page outline (#3813)
  ...
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