The Fix
pip install pydantic==1.10.19
Based on closed pydantic/pydantic issue #9404 · 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%.
@@ -1569,9 +1569,8 @@ def _generate_parameter_schema(
field = FieldInfo.from_annotated_attribute(annotation, default)
assert field.annotation is not None, 'field.annotation should not be None when generating a schema'
- source_type, annotations = field.annotation, field.metadata
with self.field_name_stack.push(name):
- schema = self._apply_annotations(source_type, annotations)
pydantic version: 2.7.1
pydantic-core version: 2.18.2
pydantic-core build: profile=release pgo=false
install path: /Users/charlesstern/miniconda3/envs/ecoscope/lib/python3.10/site-packages/pydantic
python version: 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:39:40) [Clang 15.0.7 ]
platform: macOS-14.4.1-x86_64-i386-64bit
related packages: typing_extensions-4.11.0
commit: unknown
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install pydantic==1.10.19\nWhen NOT to use: Do not apply this fix if the schema generation behavior is intended to differ for functions.\n\nOption C — Workaround\nusing a subclass of `GenerateJsonSchema`.\nWhen NOT to use: Do not apply this fix if the schema generation behavior is intended to differ for functions.\n\n
Why This Fix Works in Production
- Trigger: TypeAdapter.json_schema drops `description` from Annotated Fields when self.type is a function
- Mechanism: The `description` attribute of an Annotated Field is dropped when the type is a plain function
- Why the fix works: Fixes the issue where the `description` attribute of an Annotated Field is dropped when the type is a function. (first fixed release: 1.10.19).
- 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
- Shows up under Python 3.10 in real deployments (not just unit tests).
- The `description` attribute of an Annotated Field is dropped when the type is a plain function
- Production symptom (often without a traceback): TypeAdapter.json_schema drops `description` from Annotated Fields when self.type is a function
Proof / Evidence
- GitHub issue: #9404
- Fix PR: https://github.com/pydantic/pydantic/pull/10610
- First fixed release: 1.10.19
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.53
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Working on this now. It's quite messy, lots of core schema issues for parameters. Should have a fix done by the end of the week.”
“Hi @cisaacstern, Thanks for your kind words. We really appreciate the in-depth description and MRE :). Thanks for reporting this - definitely looks like a…”
“@sydney-runkle, thanks for your reply! Yes, I would be happy to make a PR. I will ping back here when I have one for review…”
“@cisaacstern, Fantastic! Sorry for the delayed response last week, was out for vacation.”
Failure Signature (Search String)
- TypeAdapter.json_schema drops `description` from Annotated Fields when self.type is a function
- The MRE provided below demonstrates this issue and a workaround using a subclass of `GenerateJsonSchema`.
Copy-friendly signature
Failure Signature
-----------------
TypeAdapter.json_schema drops `description` from Annotated Fields when self.type is a function
The MRE provided below demonstrates this issue and a workaround using a subclass of `GenerateJsonSchema`.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
TypeAdapter.json_schema drops `description` from Annotated Fields when self.type is a function
The MRE provided below demonstrates this issue and a workaround using a subclass of `GenerateJsonSchema`.
Minimal Reproduction
pydantic version: 2.7.1
pydantic-core version: 2.18.2
pydantic-core build: profile=release pgo=false
install path: /Users/charlesstern/miniconda3/envs/ecoscope/lib/python3.10/site-packages/pydantic
python version: 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:39:40) [Clang 15.0.7 ]
platform: macOS-14.4.1-x86_64-i386-64bit
related packages: typing_extensions-4.11.0
commit: unknown
Environment
- Python: 3.10
- Pydantic: 2
What Broke
Generated JSON Schema lacks expected descriptions for fields, leading to potential confusion.
Why It Broke
The `description` attribute of an Annotated Field is dropped when the type is a plain function
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==1.10.19
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Option C — Workaround Temporary workaround
using a subclass of `GenerateJsonSchema`.
Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.
Fix reference: https://github.com/pydantic/pydantic/pull/10610
First fixed release: 1.10.19
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not apply this fix if the schema generation behavior is intended to differ for functions.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
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.19 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.