Repository navigation
fix(theme): render branch descriptions for oneOf/anyOf and discriminator mappings - #1545
Merged
sserrata merged 3 commits intoJul 8, 2026
Merged
Conversation
…tor mappings Each oneOf/anyOf branch and each discriminator mapping target has its own `description` in the source schema, but the Schema theme dropped it silently — only the property list rendered per tab. Restore parity with SchemaNodeDetails by rendering the branch's description via MarkdownWrapper at the top of each TabItem. In AnyOneOf the description is hoisted once per TabItem so it covers every sub-branch (primitive, empty object, properties, allOf, oneOf, anyOf, items), not just the properties path. Fixes PaloAltoNetworks#1540 Co-Authored-By: Claude Opus 4.7 <[email protected]>
Adds `description` to reusable variant schemas (TypeA/TypeB/NestedTypeA/ NestedTypeB/EmptyType/NestedVariantA/NestedVariantB) in discriminator.yaml and to inline `oneOf` branches / UploadRequest components in oneOf.yaml. Every existing path that references these schemas now exercises the issue PaloAltoNetworks#1540 case (branch description must render at the top of each tab), so regressions are caught by the demo without adding new endpoints. Verified descriptions round-trip through the plugin into the generated `*.StatusCodes.json` / `*.RequestSchema.json` under demo/docs/tests/. Refs PaloAltoNetworks#1540 Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Visit the preview URL for this PR (updated for commit 2053b32): (expires Wed, 15 Jul 2026 19:55:36 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
Drop the bold-name/em-dash convention and meta commentary about issue PaloAltoNetworks#1540 in the fixture branch descriptions. They render on the demo site as if they were real API documentation, so they should read like it. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Merged
sserrata
added a commit
that referenced
this pull request
Jul 10, 2026
…w/diff thumbnails Currently the Visual Diff job runs, generates results.json + prod/preview/diff PNGs + an HTML report, and uploads them as an artifact. To see whether a PR regresses anything you have to open the Actions tab, download the artifact, unzip it, and click through the HTML report — easy to skip during review, which is what let the property-duplication regression in #1545 through. This wires up: - A second Firebase Hosting channel (`pr<N>-diffs`) per PR that hosts the visual_diffs/ directory (prod/preview/diff PNGs). Reuses the existing Hosting site + WIF auth, expires on the same 7d clock as the preview channel, ~few MB per PR. `entryPoint: visual_diffs` points the action at a scratch firebase.json + .firebaserc we write into that directory at job time so the site's real firebase.json is untouched. - scripts/build-visual-diff-comment.ts turns results.json into a Markdown body: summary counts table, then a <details> block listing each mismatched page with a <table> row of prod/preview/diff thumbnails (linked to full-size images on the diffs channel). Clean runs render a "no regressions" body so the sticky comment can overwrite a stale prior report. Skipped pages collapse into a secondary block. Long reports truncate to 25 diffs / 50 skips with a link back to the artifact HTML. - A github-script step finds any existing comment carrying the `<!-- visual-diff-report -->` marker and updates it in place, so the PR's comment thread doesn't accumulate one report per push. Uses the built-in GITHUB_TOKEN — no PAT or third-party action needed. Requires `pull-requests: write` on the visual_diff job; `id-token: write` is added for the WIF auth used by the diffs channel deploy.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
descriptionrender for eachoneOf/anyOfbranch and eachdiscriminator.mappingtarget inside theSchematheme component.TabIteminAnyOneOfso it covers every sub-branch (primitive, empty object, properties, allOf, oneOf, anyOf, items) rather than only thepropertiescase.MarkdownWrapperpattern already used bySchemaNodeDetailsand byPropertyDiscriminator's top-level description.Fixes #1540.
Root cause
AnyOneOfnever readanyOneSchema.description.PropertyDiscriminatorrendered<SchemaNode schema={discriminator.mapping[key]} />directly, andSchemaNodedoes not renderschema.descriptionitself — so mapping-target descriptions were silently dropped.Test plan
oneOf+discriminator.mappingwhere each branch has its owndescription; confirm the description text appears in each tab alongside the property list.oneOf(no discriminator) branches carrying descriptions; confirm they render.allOf/oneOfbranches inside a discriminator mapping.yarn tsc --noEmitinpackages/docusaurus-theme-openapi-docs(passes locally).🤖 Generated with Claude Code