feat(reference): add Overlay parsers, derefer and resolve strategies#189
Merged
feat(reference): add Overlay parsers, derefer and resolve strategies#189
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds first-class Overlay 1.x support to @speclynx/apidom-reference by introducing Overlay JSON/YAML parsers plus Overlay-specific resolve/dereference strategies (including extends handling), and wiring them into the saturated configuration with accompanying tests and documentation.
Changes:
- Added
overlay-json-1andoverlay-yaml-1parsers with optional parsing of the Overlayextendstarget. - Added
overlay-1dereference + resolve strategies, including optional dereferencing of theextendstarget (and deduplication when parse-phase already produced an extends result). - Updated saturated configuration, package exports/deps, docs, and tests (including snapshots); also improved Arazzo dereference to avoid duplicate source-description results.
Reviewed changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/apidom-reference/test/resolve/strategies/overlay-1/extends/index.ts | Adds resolve strategy tests for Overlay extends behavior. |
| packages/apidom-reference/test/resolve/strategies/overlay-1/extends/fixtures/overlay.json | Overlay fixture with extends for resolve tests. |
| packages/apidom-reference/test/resolve/strategies/overlay-1/extends/fixtures/overlay-no-extends.json | Overlay fixture without extends for resolve tests. |
| packages/apidom-reference/test/resolve/strategies/overlay-1/extends/fixtures/openapi.json | OpenAPI fixture used as an Overlay extends target. |
| packages/apidom-reference/test/parse/parsers/overlay-yaml-1/index.ts | Adds Overlay YAML parser test coverage including extends parsing + metadata. |
| packages/apidom-reference/test/parse/parsers/overlay-yaml-1/fixtures/sample-overlay.yaml | Sample Overlay YAML fixture for parser tests. |
| packages/apidom-reference/test/parse/parsers/overlay-yaml-1/fixtures/extends/overlay.yaml | Overlay YAML fixture with extends for parser tests. |
| packages/apidom-reference/test/parse/parsers/overlay-yaml-1/fixtures/extends/openapi.yaml | OpenAPI YAML fixture used as an Overlay YAML extends target. |
| packages/apidom-reference/test/parse/parsers/overlay-json-1/index.ts | Adds Overlay JSON parser test coverage including extends parsing + metadata. |
| packages/apidom-reference/test/parse/parsers/overlay-json-1/fixtures/sample-overlay.json | Sample Overlay JSON fixture for parser tests. |
| packages/apidom-reference/test/parse/parsers/overlay-json-1/fixtures/extends/overlay.json | Overlay JSON fixture with extends for parser tests. |
| packages/apidom-reference/test/parse/parsers/overlay-json-1/fixtures/extends/openapi.json | OpenAPI JSON fixture used as an Overlay JSON extends target. |
| packages/apidom-reference/test/dereference/strategies/overlay-1/extends/index.ts | Adds Overlay dereference tests for extends, metadata attachment, and snapshot of dereferenced $refs. |
| packages/apidom-reference/test/dereference/strategies/overlay-1/extends/fixtures/overlay.json | Overlay fixture with extends for dereference tests. |
| packages/apidom-reference/test/dereference/strategies/overlay-1/extends/fixtures/overlay-no-extends.json | Overlay fixture without extends for dereference tests. |
| packages/apidom-reference/test/dereference/strategies/overlay-1/extends/fixtures/openapi.json | OpenAPI fixture containing $ref used for dereference snapshot validation. |
| packages/apidom-reference/test/dereference/strategies/overlay-1/extends/snapshots/index.mjs.snap | Snapshot of dereferenced extends target document $ref resolution. |
| packages/apidom-reference/test/dereference/strategies/arazzo-1/source-descriptions/index.ts | Adds snapshot coverage and duplicate-prevention test for Arazzo sourceDescriptions dereference. |
| packages/apidom-reference/test/dereference/strategies/arazzo-1/source-descriptions/snapshots/index.mjs.snap | Snapshot for dereferenced Arazzo source description document. |
| packages/apidom-reference/src/resolve/strategies/overlay-1/index.ts | Introduces Overlay resolve strategy delegating to Overlay dereference to build ReferenceSet. |
| packages/apidom-reference/src/parse/parsers/overlay-yaml-1/index.ts | Introduces Overlay YAML parser wrapper + optional extends parsing hook. |
| packages/apidom-reference/src/parse/parsers/overlay-yaml-1/extends.ts | Re-exports format-agnostic parseExtends logic for YAML parser. |
| packages/apidom-reference/src/parse/parsers/overlay-json-1/index.ts | Introduces Overlay JSON parser wrapper + optional extends parsing hook. |
| packages/apidom-reference/src/parse/parsers/overlay-json-1/extends.ts | Implements parseExtends logic to parse and attach an Overlay extends target parse result. |
| packages/apidom-reference/src/dereference/strategies/overlay-1/index.ts | Introduces Overlay dereference strategy with optional extends dereferencing. |
| packages/apidom-reference/src/dereference/strategies/overlay-1/extends.ts | Implements dereferenceExtends, including reuse of parse-phase result and duplicate avoidance. |
| packages/apidom-reference/src/dereference/strategies/arazzo-1/index.ts | Prevents duplicate source-description results when both parse + dereference phases are enabled. |
| packages/apidom-reference/src/configuration/saturated.ts | Wires Overlay parsers/strategies into the default saturated configuration. |
| packages/apidom-reference/README.md | Documents new Overlay parsers and Overlay resolve/dereference strategy options and behavior. |
| packages/apidom-reference/package.json | Exposes new entrypoints for Overlay parsers/strategies and adds Overlay dependencies. |
| packages/apidom-parser-adapter-overlay-yaml-1/README.md | Expands adapter documentation (API, mediaTypes, detect, usage). |
| packages/apidom-parser-adapter-overlay-json-1/README.md | Expands adapter documentation (API, mediaTypes, detect, usage). |
| package-lock.json | Lockfile update reflecting dependency graph changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Restructured parseExtends and dereferenceExtends to use the wrapper ParseResultElement pattern (consistent with arazzo's sourceDescriptions). The extends element's meta.parseResult is now always set, regardless of success or failure, so consumers have a single consistent place to check. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify that when the extends target cannot be resolved, a ParseResultElement with error annotations is always attached to the extends element meta, consistent with arazzo's sourceDescriptions pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Document that parseResult is always attached to the extends element's meta regardless of success or failure, with on-success/on-failure details matching arazzo's pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 35 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.