Skip to content

Preserve Pydantic metadata and native root schemas - #163

Merged
vrslev merged 5 commits into
mainfrom
fix/pydantic-schema-metadata
Nov 2, 2026
Merged

vrslev merged 5 commits into
mainfrom
fix/pydantic-schema-metadata

Conversation

@vrslev

@vrslev vrslev commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Agent:

With api_metadata_enabled=True, the Litestar bootstrapper retains Pydantic model docstrings and Field(description=...) metadata on TypedDict properties. RootModel schemas describe the actual scalar, array or object value, including nested and recursive roots, while preserving native constraints and explicit model and use-site examples. The health probe describes its static checks directly on its handler.

The metadata fallback uses the initialized schema providers, preserving instrument-supplied aliases and schema owners installed by initialization plugins. Explicit descriptions and custom schema plugins retain precedence. Validation and serialization remain unchanged.

38 focused schema/HTTP tests pass, including recursion, aliases, examples and plugin ownership. The three schema helpers have 100% coverage. Repository CI lint and tests pass on Linux, macOS and Windows across Python 3.10–3.15.

@vrslev vrslev self-assigned this Nov 2, 2026
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unittests 99.47% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
microbootstrap/bootstrappers/litestar.py 99.23% <100.00%> (+<0.01%) ⬆️
...trap/instruments/litestar_pydantic_descriptions.py 100.00% <100.00%> (ø)
microbootstrap/instruments/litestar_root_schema.py 100.00% <100.00%> (ø)
...ap/instruments/litestar_typed_dict_descriptions.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vrslev
vrslev marked this pull request as ready for review November 2, 2026 13:46
@vrslev
vrslev enabled auto-merge (squash) November 2, 2026 13:47
@vrslev
vrslev merged commit 3b59773 into main Nov 2, 2026
21 checks passed
@vrslev
vrslev deleted the fix/pydantic-schema-metadata branch November 2, 2026 13:58
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