Skip to content

Add edge-case tests for complex type JSON Schema generation#150

Merged
Oaklight merged 1 commit into
masterfrom
test/issue-128-complex-type-schema-coverage
May 14, 2026
Merged

Add edge-case tests for complex type JSON Schema generation#150
Oaklight merged 1 commit into
masterfrom
test/issue-128-complex-type-schema-coverage

Conversation

@Oaklight
Copy link
Copy Markdown
Owner

Closes #128

Summary

  • Add 18 new tests in TestComplexTypeSchemaGeneration class covering complex Python type annotations and their JSON Schema output
  • Covers: Union/|, Literal, Annotated[T, Field(...)] with constraints (ge, max_length, description), nested BaseModel, Enum subclasses, Optional[list[...]], default mutable values, *args/**kwargs warnings, required field tracking, and mixed complex scenarios
  • All existing complex types already produce correct JSON Schema via Pydantic — no source changes needed, only test coverage was missing

Test plan

  • All 46 tests pass locally (30 existing + 16 new schema + 2 warning tests)
  • CI green

Add 18 new tests covering Union, Literal, Annotated with Field
constraints, nested Pydantic models, Enum subclasses, Optional
generics, default mutable values, *args/**kwargs warnings, required
field tracking, and mixed complex scenarios.
@Oaklight Oaklight merged commit 566a36a into master May 14, 2026
3 checks passed
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.

test: improve edge-case coverage for complex type JSON Schema generation

1 participant