You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5ea36ad
Browse filesBrowse the repository at this point in the historyBrowse files
feat(schema): resolve $dynamicRef against $dynamicAnchor via OpenApiSchemaReference
Implements document-scoped $dynamicRef resolution per JSON Schema
2020-12 §8.2.3.2. Bare $dynamicRef schemas (no $ref) now deserialize
as OpenApiSchemaReference whose Target resolves via per-document
$dynamicAnchor and $anchor registries in OpenApiWorkspace.
Resolution order in Target:
1. $dynamicAnchor index (single candidate → resolved automatically)
2. $anchor fallback when zero $dynamicAnchor candidates exist (per §8.2.3.2)
3. null when ambiguous (multiple candidates need dynamic-scope tracking)
Anchor registries are populated by recursively walking the entire
document tree: component schemas, reusable component definitions
(parameters, responses, request bodies, headers, callbacks, path items,
media types), inline schemas (paths, operations, webhooks), and all
nested subschema locations ($defs, properties, items, allOf, if/then/else,
etc.).
Public APIs for consumers tracking dynamic scope:
- GetDynamicAnchorCandidates(doc, anchorName): returns all candidate schemas
- ResolveDynamicAnchorInContext(contextSchema, anchorName): resolves against
a specific schema's $defs for context-dependent resolution
Other changes:
- Deserializer (V31/V32): detect bare $dynamicRef, create
OpenApiSchemaReference with IsDynamicRefOnly, parse siblings via
ApplySchemaMetadata
- JsonSchemaReference: add IsDynamicRefOnly flag, implement
IOpenApiSchemaMissingProperties, override SerializeAsV31/V32 for
dynamic-only refs
- JsonNodeHelper: GetDynamicReferencePointer, ExtractDynamicAnchorName,
IsFragmentOnlyDynamicRef
- Siblings preserved via ApplySchemaMetadata and surfaced through
existing Reference-first property getters
Fixes#2911.
0 commit comments