Skip to content

feat: externally dereference $dynamicRef#503

Open
aqeelat wants to merge 1 commit into
mattpolzin:release/7_0from
aqeelat:external-deref
Open

feat: externally dereference $dynamicRef#503
aqeelat wants to merge 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

  • 2 new tests (external → loaded component; internal → no-op), reusing the existing SchemaLoader mock.
  • Full suite: 2159 tests, 0 failures (2157 prior + 2 new).
  • v7 migration guide updated to document both the local-throw and external-resolve behavior.

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.
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.
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.

1 participant