Skip to content

Bump docusaurus-openapi-docs plugin and theme to 5.1.2#1342

Merged
sserrata merged 5 commits into
masterfrom
bump-openapi-docs-5.1.1
Jul 10, 2026
Merged

Bump docusaurus-openapi-docs plugin and theme to 5.1.2#1342
sserrata merged 5 commits into
masterfrom
bump-openapi-docs-5.1.1

Conversation

@sserrata

@sserrata sserrata commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Bumps docusaurus-plugin-openapi-docs and docusaurus-theme-openapi-docs from 5.0.2 → 5.1.2.
  • Docusaurus stays on 3.10.1 (current latest stable). Peer deps still target @docusaurus/* ^3.10.0; docusaurus-plugin-sass is already resolved to 0.2.6 in the lockfile, satisfying the theme's ^0.2.3 peer.
  • Removes stale ApiExplorer/Request swizzle and opts into the new themeConfig.api.schemaExpansion depth control — details below.

Why 5.1.2 and not 5.1.1

5.1.1 shipped a regression that duplicated outer object properties on request schemas shaped as {properties, anyOf: [{oneOf: [...]}, ...]} — first observed on POST /ethernet-interfaces, where name, default_value, link_speed, etc. rendered once at the outer object tab and again inside each aggregate_group / tap / layer2 / layer3 variant tab. 5.1.2 ships the fix from PaloAltoNetworks/docusaurus-openapi-docs#1549. This PR was validated against the 0.0.0-1337 canary before the 5.1.2 tag went out.

Why the Request swizzle had to go

The initial bump to 5.1.1 broke every API page with:

Cannot read properties of undefined (reading 'REQUEST_TITLE')

The 5.1.0 change fix(theme): make i18n strings extractable by write-translations deleted the shared translationIds dictionary (OPENAPI_REQUEST.*, etc.) and inlined the ids at each translate() call site so Docusaurus' Babel-based extractor can pick them up. The pan.dev swizzled src/theme/ApiExplorer/Request/index.js still imported OPENAPI_REQUEST from @theme/translationIds — now an empty module — so OPENAPI_REQUEST.REQUEST_TITLE threw at render time.

The swizzle's only intentional customization (per 638721afa) was bumping the fetch timeout from 10s to 30s in makeRequest.js. Upstream 5.1.x now sets DEFAULT_REQUEST_TIMEOUT = 30000 out of the box and exposes themeConfig.api.requestTimeout for further overrides — so the swizzle is entirely redundant. Dropping it also picks up:

  • write-translations-extractable i18n strings
  • categorized timeout / network / cors error messages
  • request body encoding support (multipart, urlencoded)
  • frontmatter proxy precedence over themeConfig.api.proxy
  • accessible server label via useId()
  • semantic <button> for expand/collapse (was <span>)
  • Send button visibility when a proxy is configured

Schema expansion depth

Also opts into the new 5.1.0 themeConfig.api.schemaExpansion feature (off by default upstream) so the depth picker (0…4 / all) appears on the request-body Schema tab:

api: {
  schemaExpansion: { enabled: true, default: 0, max: 4, persist: true },
}

Notable changes between 5.0.2 and 5.1.2

5.1.2 (patch)

  • fix(theme): stop duplicating branch properties in nested anyOf/oneOf renders (#1549)

5.1.1 (patch)

  • fix(plugin): rank Postman path matchers by per-segment specificity
  • fix(theme): render branch descriptions for oneOf/anyOf and discriminator mappings
  • fix(theme): hoist schema normalization out of the render path (perf)

5.1.0 (minor — highlights)

  • feat(theme): configurable schema expansion level (themeConfig.api.schemaExpansion)
  • fix(theme): make i18n strings extractable by write-translations
  • fix(theme): vendor theme-common/internal usages ahead of Docusaurus v4
  • fix(theme): prefill "Send API Request" from example fields
  • fix(plugin): render OpenAPI 3.1 type unions in schema names
  • fix(theme): preserve large-integer precision in response panel
  • fix: render nested arrays as Type[][] in the Schema tab
  • fix: dedupe properties when allOf override redefines nested array items

Release notes: v5.1.2, v5.1.1, v5.1.0

Test plan

  • Preview deploy loads API pages without the REQUEST_TITLE runtime error (repro was /prisma-airs/api/airuntimesecurity/management/create-new-api-key/)
  • POST /ethernet-interfaces (/scm/api/config/sase/network configurations/create-ethernet-interfaces/) renders base properties once per variant tab, not twice
  • Schema expansion depth picker appears on the request-body Schema tab and controls initial depth
  • Request panel still renders — Base URL / Auth / Parameters / Body / Accept / Send button
  • Send API Request still works end-to-end against a live server
  • CI green (build + link check)

🤖 Generated with Claude Code

Upgrades docusaurus-plugin-openapi-docs and docusaurus-theme-openapi-docs
from 5.0.2 to 5.1.1. No breaking changes; peer deps still target
@docusaurus/* ^3.10.0 (we're on 3.10.1).

Notable fixes/features between 5.0.2 and 5.1.1:
- Configurable schema expansion level (themeConfig.api.schemaExpansion)
- Render branch descriptions for oneOf/anyOf and discriminator mappings
- Hoist schema normalization out of the render path (perf)
- Rank Postman path matchers by per-segment specificity
- Prefill "Send API Request" from example fields
- Preserve large-integer precision in the response panel
- Render nested arrays as Type[][] in the Schema tab
- Vendor theme-common/internal usages ahead of Docusaurus v4
@sserrata sserrata requested a review from a team as a code owner July 10, 2026 15:12
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit c0a444f):

https://pan-dev-f1b58--pr1342-8sh0o4fo.web.app

(expires Fri, 17 Jul 2026 19:50:13 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 9359a9fa100d5fdb082f75280473a90b1f96eb51

The swizzled Request/index.js was crashing on 5.1.1 with
"Cannot read properties of undefined (reading 'REQUEST_TITLE')"
because 5.1.0 removed the shared translationIds dictionary
(OPENAPI_REQUEST.*) and inlined the ids at each translate() call
site so `docusaurus write-translations` can extract them via static
analysis. The swizzled copy still imported the removed constants.

The only intentional customization in the swizzle was bumping the
fetch timeout from 10s to 30s (see 638721a). Upstream 5.1.x
now sets DEFAULT_REQUEST_TIMEOUT = 30000 out of the box and exposes
`themeConfig.api.requestTimeout` for further overrides, so the
swizzle is redundant.

Dropping it also picks up upstream improvements:
- write-translations-extractable i18n strings
- categorized timeout / network / cors error messages
- request body encoding support (multipart, urlencoded)
- frontmatter proxy precedence over themeConfig proxy
- accessible server label via useId()
- semantic <button> for expand/collapse (was <span>)
- Send button visibility when a proxy is configured
Opts into the 5.1.0 themeConfig.api.schemaExpansion feature so the
depth picker (0..4 / all) appears in the RequestSchema panel. Off by
default upstream (config.enabled defaults to false).

Defaults chosen:
- default: 0    — collapsed on load; matches prior behavior
- max: 4        — matches upstream default
- persist: true — remember the reader's last pick in localStorage
Temporarily point at the 0.0.0-1337 canary so this PR's preview build exercises
the property-duplication fix from docusaurus-openapi-docs PR #1549 end-to-end.
Revert to a real 5.1.x tag before merge.
Swaps the 0.0.0-1337 canary for the tagged 5.1.2 patch, which contains the
fix for the property-duplication regression seen on request schemas with
`type: object` + outer `properties` + `anyOf: [{oneOf: [...]}, ...]`
(docusaurus-openapi-docs PR #1549).
@sserrata sserrata changed the title Bump docusaurus-openapi-docs plugin and theme to 5.1.1 Bump docusaurus-openapi-docs plugin and theme to 5.1.2 Jul 10, 2026
@sserrata sserrata merged commit f8ae6e3 into master Jul 10, 2026
6 checks passed
@sserrata sserrata deleted the bump-openapi-docs-5.1.1 branch July 10, 2026 19:52
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.

1 participant