Repository navigation
fix: preserve literal reference fields in MCP schema data - #214
Merged
Merged
Conversation
This was referenced Oct 4, 2026
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.
MCP schema normalization previously interpreted every JSON field named $ref as a schema reference, including ordinary default/const/enum/examples and custom annotation values. Valid literal remote/missing references could abort catalog initialization, and matching local values were silently rewritten.
Walk only schema keyword positions when collecting/replacing references. Explicit reference targets are still inspected transitively (with cycle protection) and normalized in definition copies, preserving the source instance data. Existing remote/unresolvable-reference rejection and deterministic recursive reference handling remain intact. Closes #211; child of #210.
Validation: 16 regression cases fail on the original implementation; all 38 focused tests pass after the fix with zero skips/warnings. Coverage includes instance data, scalar/array/map/legacy schema slots, recursive and transitive references, invalid actual references and idempotence. Tool-less Claude advisory review identified a deep $defs data-target bypass; Codex reproduced it with three failing cases and corrected it by also relocating deep definition pointers. Direct definition references retain their existing handling. Release2024/2025/2026/2027 x64 L2 passed on final SHA 111f63c; Both CI runs 37190697123 / 37190661065 passed with 2,393 tests and zero skips. The traversal intentionally shares the existing schema-keyword registry; adding dialect keywords such as contentSchema is outside this task, as are pre-existing dangling direct-definition and true-subschema-in-data-target gaps; all three are tracked for verification/fix in #215. No tool contract changes or Navisworks runtime claim.