Skip to content

@W-23748899 feat(composition): render OAS 3.1 if/then/else conditional schemas - #102

Merged
alexpmule merged 4 commits into
mainfrom
W-23748896-composition-labels
Aug 26, 2026
Merged

@W-23748899 feat(composition): render OAS 3.1 if/then/else conditional schemas#102
alexpmule merged 4 commits into
mainfrom
W-23748896-composition-labels

Conversation

@alexpmule

@alexpmule alexpmule commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What

Brings the OAS 3.1 / JSON Schema 2020-12 if/then/else conditional-schema rendering (W-23748899) to main.

Why this PR existed

PR #101 (the if/then/else feature) was merged into the W-23748896-composition-labels feature branch, not main. So the feature — and the 4.2.46 version bump that came right after it — lived only on the feature branch and never reached main. This repo publishes to npm on push to main (workflow "Tests and publishing" / deployment.yml), so npm still showed 4.2.45 as latest and consumers couldn't install the feature. This PR retargets the work onto main so it ships.

What's included

The 3 commits ahead of main on W-23748896-composition-labels:

main was only 1 commit ahead (the merge commit of PR #100, whose content is already in this branch), so the 3-way merge was clean.

Publish outcome

After merging, the push-to-main workflow published 4.2.46 — which DOES contain if/then/else — to npm. The feature commit 717569c is an ancestor of tag v4.2.46 (git compare 717569c...v4.2.46 = ahead 1, behind 0), and the published integrity matches what API Console v6 now resolves. No 4.2.47 is needed. API Console v6 resolves @api-components/api-type-document at 4.2.46.

Correction: an earlier version of this description stated that 4.2.46 had been published without the feature and that a 4.2.47 bump was required. That was wrong — the 4.2.46 bump commit sits after the feature commit, so the tag and the published tarball include it. The version only looked "featureless" on npm because it had not yet been published from main, which this PR fixed.

Testing

The feature commit ships its unit tests (recursive if/then/else branch rendering, mirroring the existing oneOf/anyOf/allOf pattern; then and else independently optional). No regression to existing composition rendering.

Refs

alexpmule and others added 4 commits August 26, 2026 00:08
JSON Schema 2020-12 / OAS 3.1 if/then/else keywords were parsed by AMF
but not rendered: a shape whose only content was a conditional fell
through to the AnyShape scalar fallback and collapsed to a generic
"Any" badge.

Detect shacl#if/then/else in _typeChanged (raw IRIs built from the
frozen shacl namespace prefix, since amf-helper-mixin exposes no
if/then/else members) and render each present branch via a recursive
api-type-document, mirroring the existing oneOf/anyOf/allOf pattern.
then and else are independently optional per JSON Schema, so an
if-plus-else shape without then renders both branches, not a blank.
…else-conditional-schemas

@W-23748899 feat(composition): render if/then/else conditional schemas
@alexpmule alexpmule closed this Aug 26, 2026
@alexpmule alexpmule reopened this Aug 26, 2026
@alexpmule
alexpmule merged commit fc52891 into main Aug 26, 2026
5 checks passed
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