Skip to content

fix: retrieve pydantic example from json_schema_extra - #5024

Open
XanthanGum wants to merge 1 commit into
litestar-org:mainfrom
XanthanGum:patch-1
Open

fix: retrieve pydantic example from json_schema_extra#5024
XanthanGum wants to merge 1 commit into
litestar-org:mainfrom
XanthanGum:patch-1

Conversation

@XanthanGum

Copy link
Copy Markdown

Add logic to retrieve example from json_schema_extra if not set.

Description

Pydantic models were not passing through examples via model_config = ConfigDict(json_schema_extra={'example':{'name':'XanthanGum'}}

Mentioned in #3181, point 6.

Add logic to retrieve example from json_schema_extra if not set.
@XanthanGum
XanthanGum requested review from a team as code owners August 29, 2026 08:56
@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.18%. Comparing base (cbc0c51) to head (a731fe5).

Files with missing lines Patch % Lines
litestar/plugins/pydantic/utils.py 25.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5024      +/-   ##
==========================================
- Coverage   67.19%   67.18%   -0.02%     
==========================================
  Files         293      293              
  Lines       15363    15367       +4     
  Branches     1745     1747       +2     
==========================================
+ Hits        10323    10324       +1     
- Misses       4890     4891       +1     
- Partials      150      152       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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