Repository navigation
fix(ns-arazzo-1): refract Hyper-Schema links in JSON Schema - #5282
Open
robert-hebel-sb wants to merge 1 commit into
Open
robert-hebel-sb wants to merge 1 commit into
robert-hebel-sb wants to merge 1 commit into
Conversation
The Arazzo specification object embeds the JSON Schema 2020-12 `JSONSchema` visitors but not `LinkDescription`, so a schema with Hyper-Schema `links` threw `VisitorClz is not a constructor`, both in Arazzo documents (e.g. Workflow `inputs`) and, because Arazzo registers its refractor on the JSON Schema 2020-12 element class, in standalone JSON Schema 2020-12 documents parsed while Arazzo is loaded (apidom-reference's saturated configuration, apidom-ls). Add `LinkDescription` from the JSON Schema 2020-12 specification, as the OpenAPI 3.1/3.2 and AsyncAPI specifications do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been 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.
Arazzo's refractor specification embeds the JSON Schema 2020-12
JSONSchemavisitors but notLinkDescription. A schema with Hyper-Schemalinkstherefore throwsTypeError: VisitorClz is not a constructor:inputsschema withlinks;refractor on the JSON Schema 2020-12 element class, so once apidom-reference's saturated
configuration is imported (as apidom-ls does), the 2020-12 parser adapters refract with Arazzo's
specification.
Changes
apidom-ns-arazzo-1/src/refractor/specification.ts: addLinkDescriptionfrom the JSON Schema2020-12 specification object, as the OpenAPI 3.1/3.2 and AsyncAPI 2/3 specifications already do.
inputsschema haslinksrefracts them tolinkDescription, and the JSON Schema 2020-12JSONSchemaElement.refractstill handleslinkswhile Arazzo is loaded.
Verification
9 warnings that predate this change)
VisitorClz is not a constructor)Known gaps
refracton the class it imports fromapidom-ns-json-schema-2020-12, sothat class refracts with Arazzo's specification (and Arazzo's toolbox for plugins) whenever
Arazzo is loaded. With this fix the result is the same, but Arazzo should register its refractor
on its own subclass. Left for a follow-up to keep this change to one entry.
Needed by JSON Schema 2020-12 support in apidom-ls (#5280): until this lands, 2020-12 documents
using Hyper-Schema
linksfail to parse there.🤖 Generated with Claude Code