Repository navigation
Schema inference: resolve string annotations, Annotated and NewType (#27) - #28
Merged
Merged
Conversation
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.
Closes #27.
resolve_annotations(func, parameters)(ju.util): evaluates string annotations viatyping.get_type_hints(partials, callable instances, bound methods, classes), falling back to per-parameter eval; unresolvable ones are left as-is. Used bysignature_to_json_schema.unwrap_optionalalso peelsAnnotated,NewTypeandtype X = ...aliases (top level and union members), which feedsis_typeand arrayitems.itemsinference now hands a customparam_to_prop_typea Parameter carrying the owning parameter's real name (was_).ju/tests/annotations_test.py(underfrom __future__ import annotations).Review: fresh Opus reviewer: fix-then-merge. Confirmed and fixed: a recursive
typealias crashed with RecursionError (items nesting now bounded), a cycle of aliases looped forever (now detected), a class defining only__new__kept string annotations (now resolved). Tests added for each.🤖 Generated with Claude Code
Dependents gate: 11 pass, 1 fail (smart-cv, collection errors, pre-existing).