Skip to content

feat: externally dereference $dynamicRef - #503

Merged
mattpolzin merged 1 commit into
mattpolzin:release/7_0from
aqeelat:external-deref
Jul 29, 2026
Merged

feat: externally dereference $dynamicRef#503
mattpolzin merged 1 commit into
mattpolzin:release/7_0from
aqeelat:external-deref

Conversation

@aqeelat

@aqeelat aqeelat commented Jul 10, 2026

Copy link
Copy Markdown

Part of #359.

Implements the "External dereferencing of $dynamicRef" item from the #359 task list. The .dynamicReference case of externallyDereferenced(with:) previously passed through unchanged (with a TODO); it now delegates to the wrapped JSONReference's external deref — reusing the same tested path $ref uses.

  • External $dynamicRef (target is an external URI): fetched via the supplied ExternalLoader and rewritten to an internal component reference.
  • Internal $dynamicRef (anchor): unchanged (external deref is a no-op for internal refs, mirroring $ref).
  • The result remains a .dynamicReference (still serializes as $dynamicRef), preserving the dynamic-anchor semantic. Cross-document dynamic-scope resolution stays out of scope (tracked separately in Support $dynamicRef and $dynamicAnchor #359).

Testing


This PR was drafted with assistance from AI tooling. The submitter has reviewed and validated the contents prior to submission.

aqeelat added a commit to aqeelat/OpenAPIKit that referenced this pull request Jul 11, 2026
…ferencing

locallyDereferenced() / dereferenced(in:) now resolve $dynamicRef against the
dynamic scope (outermost $dynamicAnchor wins, per JSON Schema 2020-12).
Non-recursive targets are inlined; recursive or unresolvable dynamic refs
throw, consistent with static $ref cycles and the Dereferenced... invariant
(a DereferencedJSONSchema must not contain references).

Implements the 'dynamic-scope-aware dereferencing' item from mattpolzin#359. Edits the
same migration-guide section as mattpolzin#503 (external deref); reconcile on merge.

Part of mattpolzin#359.
Comment thread documentation/migration_guides/v7_migration_guide.md Outdated
Delegate the .dynamicReference case of externallyDereferenced to the wrapped
JSONReference's external deref -- the same path $ref uses. External $dynamicRef
targets are fetched via the loader and rewritten to internal component
references; internal dynamic refs are unchanged. The result stays a
.dynamicReference (serializes as $dynamicRef, preserving the dynamic semantic).

Part of mattpolzin#359.
@mattpolzin
mattpolzin merged commit 31a77ef into mattpolzin:release/7_0 Jul 29, 2026
9 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.

2 participants