@W-23748899 feat(composition): render OAS 3.1 if/then/else conditional schemas - #102
Merged
Conversation
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
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.
What
Brings the OAS 3.1 / JSON Schema 2020-12
if/then/elseconditional-schema rendering (W-23748899) tomain.Why this PR existed
PR #101 (the if/then/else feature) was merged into the
W-23748896-composition-labelsfeature branch, notmain. So the feature — and the4.2.46version bump that came right after it — lived only on the feature branch and never reachedmain. This repo publishes to npm on push tomain(workflow "Tests and publishing" /deployment.yml), so npm still showed4.2.45as latest and consumers couldn't install the feature. This PR retargets the work ontomainso it ships.What's included
The 3 commits ahead of
mainonW-23748896-composition-labels:717569c—@W-23748899 feat(composition): render if/then/else conditional schemas(the feature)8efa3e4—4.2.46(version bump — sits after the feature commit, so the tag/tarball include it)bd2cc0a— merge of PR @W-23748899 feat(composition): render if/then/else conditional schemas #101mainwas 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-
mainworkflow published4.2.46— which DOES contain if/then/else — to npm. The feature commit717569cis an ancestor of tagv4.2.46(git compare 717569c...v4.2.46= ahead 1, behind 0), and the published integrity matches what API Console v6 now resolves. No4.2.47is needed. API Console v6 resolves@api-components/api-type-documentat4.2.46.Testing
The feature commit ships its unit tests (recursive if/then/else branch rendering, mirroring the existing oneOf/anyOf/allOf pattern;
thenandelseindependently optional). No regression to existing composition rendering.Refs
main)