Skip to content

Fix typed dictionary ref resolution#82

Open
quinnj wants to merge 1 commit into
masterfrom
codex/fix-typed-ref-resolution
Open

Fix typed dictionary ref resolution#82
quinnj wants to merge 1 commit into
masterfrom
codex/fix-typed-ref-resolution

Conversation

@quinnj

@quinnj quinnj commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Copy Base Dict schema inputs into widened Dict{K,Any} containers before resolving refs.
  • Preserve parsed JSON object behavior by leaving non-Dict schema containers on the existing deepcopy path.
  • Add a regression test for issue Expanding $refs fails if Dict is strictly typed #81 covering a strictly typed nested dictionary and ensuring the caller's input remains unchanged.

Root Cause

Schema(::AbstractDict) deep-copied user input without widening nested Dict value types. During $ref expansion, the resolver replaces a string ref with the referenced schema dictionary, which fails for nested dictionaries inferred as Dict{String,String}.

Fixes #81

Validation

  • julia --startup-file=no --project=. -e 'using Pkg; Pkg.test()'

Co-authored by Codex

Copy Base Dict schema inputs into Dict{K,Any} before resolving refs so strictly typed nested dictionaries can hold resolved schema objects. Keep parsed JSON objects on the existing deepcopy path to preserve current behavior.

Fixes #81
@quinnj quinnj force-pushed the codex/fix-typed-ref-resolution branch from 50c4742 to c66eb0f Compare July 3, 2026 17:58
@quinnj quinnj marked this pull request as ready for review July 3, 2026 18:07
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.

Expanding $refs fails if Dict is strictly typed

1 participant