Skip to content

feat(reference): add Overlay parsers, derefer and resolve strategies#189

Merged
char0n merged 4 commits intomainfrom
char0n/reference-overlay-integration
Apr 7, 2026
Merged

feat(reference): add Overlay parsers, derefer and resolve strategies#189
char0n merged 4 commits intomainfrom
char0n/reference-overlay-integration

Conversation

@char0n
Copy link
Copy Markdown
Member

@char0n char0n commented Mar 21, 2026

No description provided.

@char0n char0n requested a review from Copilot March 21, 2026 21:55
@char0n char0n self-assigned this Mar 21, 2026
@char0n char0n added the enhancement New feature or request label Mar 21, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-1 and overlay-yaml-1 parsers with optional parsing of the Overlay extends target.
  • Added overlay-1 dereference + resolve strategies, including optional dereferencing of the extends target (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.

Comment thread packages/apidom-reference/src/dereference/strategies/overlay-1/extends.ts Outdated
Comment thread packages/apidom-reference/README.md
char0n and others added 3 commits April 7, 2026 21:46
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@char0n char0n merged commit 7e4565b into main Apr 7, 2026
12 checks passed
@char0n char0n deleted the char0n/reference-overlay-integration branch April 7, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants