The Fix
pip install pydantic==2.10.1
Based on closed pydantic/pydantic issue #10917 · 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%.
@@ -249,7 +249,7 @@ configuration value on the dataclass:
import dataclasses
-from pydantic import BaseModel
+from pydantic import BaseModel, ConfigDict
from pydantic.errors import PydanticSchemaGenerationError
from dataclasses import dataclass
from pydantic import BaseModel, ConfigDict
class ArbitraryType: pass
@dataclass
class DC:
a: ArbitraryType
class Model(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True)
dc: DC
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==2.10.1\nWhen NOT to use: Do not use this fix if your dataclass requires its own specific configuration.\n\nOption C — Workaround\nis to define dataclass like this:\nWhen NOT to use: Do not use this fix if your dataclass requires its own specific configuration.\n\n
Why This Fix Works in Production
- Trigger: pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class '__main__.ArbitraryClass'>. Set…
- Mechanism: Pydantic did not inherit configuration from parent models for stdlib dataclasses
- Why the fix works: Fixes the issue with dataclass configuration inheritance in Pydantic by using the parent configuration during schema generation for stdlib dataclasses. (first fixed release: 2.10.1).
- 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
- Pydantic did not inherit configuration from parent models for stdlib dataclasses
- Surfaces as: pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class '__main__.ArbitraryClass'>. Set `arbitrary_types_allowed=True` in the…
Proof / Evidence
- GitHub issue: #10917
- Fix PR: https://github.com/pydantic/pydantic/pull/10928
- First fixed release: 2.10.1
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.75
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.53
Verified Execution
We executed the runnable minimal repro in a temporary environment and captured exit codes + logs.
- Status: PASS
- Ran: 2026-02-11T16:52:29Z
- Package: pydantic
- Fixed: 2.10.1
- Mode: fixed_only
- Outcome: ok
Logs
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Hey folks! We've just released v2.10.1 with a fix for this issue! Let us know if you're still experiencing any difficulties. Thanks!”
“We used this functionality to create a Fastapi response model created from a dataclass defined in a external dependency”
“We define those dataclassess in a separate component that is not aware about Pydantic at all. They are also used in non-Pydantic context, so we…”
“Upon further consideration, we've decided we definitely should fix this”
Failure Signature (Search String)
- pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class '__main__.ArbitraryClass'>. Set `arbitrary_types_allowed=True` in the
Error Message
Stack trace
Error Message
-------------
pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class '__main__.ArbitraryClass'>. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
If you got this error by calling handler(<some type>) within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema(<some type>)` since we do not call `__get_pydantic_core_schema__` on `<some type>` otherwise to avoid infinite recursion.
For further information visit https://errors.pydantic.dev/2.10/u/schema-for-unknown-type
Minimal Reproduction
from dataclasses import dataclass
from pydantic import BaseModel, ConfigDict
class ArbitraryType: pass
@dataclass
class DC:
a: ArbitraryType
class Model(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True)
dc: DC
What Broke
Users experienced schema generation errors when using dataclasses with arbitrary types.
Why It Broke
Pydantic did not inherit configuration from parent models for stdlib dataclasses
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==2.10.1
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Option C — Workaround Temporary workaround
is to define dataclass like this:
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/10928
First fixed release: 2.10.1
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use this fix if your dataclass requires its own specific configuration.
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 |
|---|---|
| 2.10.1 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.