@W-23748896 feat(composition): render meaningful labels for oneOf/anyOf/allOf variants (OAS 3.1) - #100
Merged
Conversation
…iants (OAS 3.1) OAS 3.1/3.2 inline composition members compile to AMF shapes with synthetic names (item0, item1, amf_inline_type...). These leaked into the variant tab labels, so users saw 'item0'/'item1' instead of readable option names. Detect placeholder labels via _isPlaceholderTypeLabel and replace them: scalar members fall back to their range data type, object members to 'Option N'. Named $ref members (EmailContact, PetBase) keep their names. Covered by two suites: composition-labels.test.js builds AMF nodes inline (generator-independent), and composition-labels-fixture.test.js loads a real AMF-5.11 oas31-webhooks model through the full expand pipeline and asserts the rendered labels (skips, never reds, if the fixture is absent). W-23748896
alexpmule
force-pushed
the
W-23748896-composition-labels
branch
from
August 18, 2026 22:17
b179fa8 to
4087ca3
Compare
…p generator to 0.4.0 Bump @api-components/api-model-generator ^0.2.14 -> ^0.4.0 (amf-client-js 5.11 supports OAS 3.1/3.2). Add a real OAS 3.1 demo spec exercising oneOf/anyOf/allOf composition and register it so prepare generates its model. Make test/amf-loader.js @graph-aware (amf-client-js 5.11 emits flattened @graph models) and rewrite the composition-label tests to drive the generated model instead of hand-building AMF inline. The generated models are prepare artifacts: untrack demo/oas31-webhooks*.json and drop their .gitignore whitelist (they regenerate via `npm run prepare`). Adapt property-document-mixin / property-shape-document tests to the 5.11 compact shape (context-relative IRIs; source maps stripped from compact models). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…egistry The lockfile had 20 `resolved` URLs pointing at the internal nexus-proxy.repo.local.sfdc.net mirror, which the public GitHub Actions runner cannot resolve — `npm install` failed with ENOTFOUND before any test ran. Regenerated with an explicit --registry=https://registry.npmjs.org/ so every tarball resolves from the public registry. Versions are unchanged (generator 0.4.0, amf-helper-mixin 4.5.38, amf-client-js 5.11.12531); local suite: 572 passed, 0 failed.
alexpmule
marked this pull request as ready for review
August 24, 2026 00:53
spezzirriemiliano
approved these changes
Aug 24, 2026
This was referenced Aug 26, 2026
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.
@W-23748896
What
Renders meaningful labels for
oneOf/anyOf/allOfcomposition variants.AMF names inline composition members with placeholder labels (
item0,item1, … andamf_inline_type…). This detects those placeholders (_isPlaceholderTypeLabel) and substitutes a meaningful label so the composition variants read clearly instead of showingitem0/item1.Why
TD-0333486 — OAS 3.1/3.2 support in API Console v6. AC1: composition schemas must render readable variant labels.
Tests
18/18 green in chromium + firefox: 15 inline AMF expanded-model tests + 3 real-model tests loading the
oas31-webhookscompact model through the full expand pipeline (this.skip()if the fixture is absent — degrades to skip, never red). The fixtures are whitelisted in.gitignoreand committed so the real-model tests run in CI.Screenshot