Skip to content

fix(theme): import Schema helpers from theme package for openapi-docs v5#513

Merged
steve-calvert-glean merged 1 commit intomainfrom
fix/openapi-docs-v5-schema-import
Apr 27, 2026
Merged

fix(theme): import Schema helpers from theme package for openapi-docs v5#513
steve-calvert-glean merged 1 commit intomainfrom
fix/openapi-docs-v5-schema-import

Conversation

@steve-calvert-glean
Copy link
Copy Markdown
Contributor

Summary

  • /api/indexing-api/bulk-index-employees was crashing on production with TypeError: (0, em.getQualifierMessage) is not a function.
  • Root cause: the v5.0.1 bump of docusaurus-plugin-openapi-docs removed getQualifierMessage from lib/markdown/schema; it now lives only in docusaurus-theme-openapi-docs/lib/markdown/schema. Our swizzled src/theme/Schema/index.tsx still imported from the old plugin path, so the symbol silently resolved to undefined and any schema whose render path hit the call (e.g. the allOf/object shape in bulk-index-employees) crashed. Simpler schemas like /index-employee didn't trip the code path, which is why only some pages broke.
  • Fix: one-line import swap in the swizzle to pull both helpers from the theme package.

Test plan

  • pnpm build succeeds
  • pnpm exec docusaurus serve/api/indexing-api/bulk-index-employees renders schema, params, and response sections with no getQualifierMessage error in the console
  • /api/indexing-api/index-employee still renders (no regression on the previously-working pages)
  • After deploy, confirm production page loads clean

Follow-up (not in this PR)

Reaching into /lib/ of an upstream package is the pattern that broke here. Worth a separate hardening pass to either inline the two small helpers into a local util or refresh the swizzle against v5 upstream and keep the Glean customizations as a thinner wrapper.

🤖 Generated with Claude Code

After bumping to docusaurus-plugin-openapi-docs@5.0.1 and
docusaurus-theme-openapi-docs@5.0.1, getQualifierMessage was removed
from the plugin's lib/markdown/schema and now lives only in the theme
package. The swizzled Schema component still imported from the old
plugin path, so the symbol silently became undefined and any page
whose schema hit the call path crashed with
"TypeError: getQualifierMessage is not a function"
(e.g. /api/indexing-api/bulk-index-employees).

Update the import to pull both helpers from the theme package where
they now live.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@steve-calvert-glean steve-calvert-glean requested a review from a team as a code owner April 27, 2026 20:32
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
glean-developer-site Ready Ready Preview, Comment Apr 27, 2026 8:33pm

Request Review

@steve-calvert-glean steve-calvert-glean merged commit 43bc313 into main Apr 27, 2026
4 checks passed
@steve-calvert-glean steve-calvert-glean deleted the fix/openapi-docs-v5-schema-import branch April 27, 2026 21:47
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.

5 participants