The Fix
pip install pydantic==1.10.18
Based on closed pydantic/pydantic issue #10173 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -90,7 +90,7 @@ try:
@classmethod
def __modify_schema__(cls, field_schema):
- field_schema.update(examples='examples')
+ field_schema.update(examples=['example'])
Option A — Upgrade to fixed release\npip install pydantic==1.10.18\nWhen NOT to use: Do not use this fix if the JSON Schema generation logic is fundamentally changed.\n\n
Why This Fix Works in Production
- Trigger: Make sure generated JSON Schemas are valid in tests
- Mechanism: Invalid JSON Schemas were generated due to incorrect examples format in the schema generation method
- Why the fix works: Ensures that generated JSON Schemas are valid by adding validation checks in the tests. (first fixed release: 1.10.18).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- Invalid JSON Schemas were generated due to incorrect examples format in the schema generation method
- Production symptom (often without a traceback): Make sure generated JSON Schemas are valid in tests
Proof / Evidence
- GitHub issue: #10173
- Fix PR: https://github.com/pydantic/pydantic/pull/10182
- First fixed release: 1.10.18
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.74
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“### Initial Checks - [X] I have searched Google & GitHub for similar requests and couldn't find anything - [X] I have read and followed the docs and still think this feature is missing ### Description https://github.com/pydantic/pydantic/is”
Failure Signature (Search String)
- Make sure generated JSON Schemas are valid in tests
- - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
Copy-friendly signature
Failure Signature
-----------------
Make sure generated JSON Schemas are valid in tests
- [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Make sure generated JSON Schemas are valid in tests
- [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
What Broke
Generated JSON Schemas were invalid, causing tests to fail unexpectedly.
Why It Broke
Invalid JSON Schemas were generated due to incorrect examples format in the schema generation method
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==1.10.18
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/pydantic/pydantic/pull/10182
First fixed release: 1.10.18
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use this fix if the JSON Schema generation logic is fundamentally changed.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
Version Compatibility Table
| Version | Status |
|---|---|
| 1.10.18 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.