Skip to content

fix: inline nested schema references with annotations - #287

Closed
Kayvan-Zahiri wants to merge 1 commit into
exa-labs:masterfrom
Kayvan-Zahiri:codex/inline-schema-references-with-siblings
Closed

Kayvan-Zahiri wants to merge 1 commit into
exa-labs:masterfrom
Kayvan-Zahiri:codex/inline-schema-references-with-siblings

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

A nested Pydantic field with Field(description=...) generates a $ref alongside an annotation. InlineJsonSchemaGenerator only resolves pure $ref objects, then deletes $defs, leaving a dangling reference in the schema sent by answer. Titles/examples and additional schema constraints have the same problem.

Resolve local references even when siblings are present. Retain the referenced schema and the siblings together using allOf, including any existing sibling allOf constraints, so neither side overwrites the other's validation rules. Pure references retain their existing flattened representation.

Add six regression cases: four annotation/constraint combinations and public sync/async answer request-body checks. These use dummy keys and mocked request methods. Recursive/unresolvable references and their existing behavior are outside scope; no claim of hosted API acceptance.

Validation on Python 3.12 with the frozen uv environment:

  • Before: six regressions fail, eleven existing schema tests pass.
  • After: all seventeen schema tests pass; full unit suite: 679 passed, eight warnings.
  • Documentation generator, sdist/wheel build and git diff --check pass.
  • The full unit suite uses local HTTP fixtures with loopback permissions.

Dependency/version metadata and generated documentation are unchanged. No authenticated Exa calls or paid compute were used. Integration tests requiring a real API key were not run.

@kesku kesku closed this Nov 2, 2026
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