The Fix
pip install pydantic==2.12.0
Based on closed pydantic/pydantic issue #10785 · PR/commit linked
Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.
@@ -62,7 +62,12 @@
from ..json_schema import JsonSchemaValue
from ..version import version_short
-from ..warnings import ArbitraryTypeWarning, PydanticDeprecatedSince20, UnsupportedFieldAttributeWarning
+from ..warnings import (
+ ArbitraryTypeWarning,
from pydantic import ValidationError, BaseModel
from devtools import debug
from pydantic.json_schema import GenerateJsonSchema
from pydantic_core import SchemaValidator, core_schema
class Model(BaseModel):
a: int
b: int
schema = core_schema.model_schema(
Model,
core_schema.model_fields_schema(
{
'a': core_schema.model_field(core_schema.int_schema()),
'b': core_schema.model_field(core_schema.int_schema()),
},
),
extra_behavior='forbid',
)
json_schema = GenerateJsonSchema().generate(schema)
debug(json_schema)
"""
json_schema: {
'properties': {
'a': {
'title': 'A',
'type': 'integer',
},
'b': {
'title': 'B',
'type': 'integer',
},
},
'required': ['a', 'b'],
'title': 'Model',
'type': 'object',
}
"""
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.12.0\nWhen NOT to use: This fix is not applicable if you require TypedDicts to allow additional properties.\n\n
Why This Fix Works in Production
- Trigger: Change JSON schema (and maybe config) default for `extra` for `dataclass`es and `TypedDict`s
- Mechanism: The default behavior for TypedDicts and dataclasses regarding additional properties in JSON schema was inconsistent
- Why the fix works: Adds support for PEP 728 and modifies the default behavior for TypedDicts and dataclasses regarding additional properties in JSON schema. (first fixed release: 2.12.0).
- 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
- The default behavior for TypedDicts and dataclasses regarding additional properties in JSON schema was inconsistent
- Production symptom (often without a traceback): Change JSON schema (and maybe config) default for `extra` for `dataclass`es and `TypedDict`s
Proof / Evidence
- GitHub issue: #10785
- Fix PR: https://github.com/pydantic/pydantic/pull/12179
- First fixed release: 2.12.0
- 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.47
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“@sydney-runkle I'd add that Doesn't solve the problem — with both 2.9 and 2.10 additionalProperties is missing.”
“@Viicos I bet you're aware, but PEP 728 has been accepted[^1] [^1]: https://discuss.python.org/t/pep-728-typeddict-with-typed-extra-items/45443/159”
“In some ways, this is more consistent with models and dataclasses, where the extra_behavior spec on core_schema wasn't considered when generating json schema in previous…”
“We can chat about final behavior in our oss sync this morning 👍”
Failure Signature (Search String)
- Change JSON schema (and maybe config) default for `extra` for `dataclass`es and `TypedDict`s
- You'll see that `'additionalProperties': False` is included in `2.9.2`, but missing with `2.10.0b1`. I think this change comes from #10675.
Copy-friendly signature
Failure Signature
-----------------
Change JSON schema (and maybe config) default for `extra` for `dataclass`es and `TypedDict`s
You'll see that `'additionalProperties': False` is included in `2.9.2`, but missing with `2.10.0b1`. I think this change comes from #10675.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Change JSON schema (and maybe config) default for `extra` for `dataclass`es and `TypedDict`s
You'll see that `'additionalProperties': False` is included in `2.9.2`, but missing with `2.10.0b1`. I think this change comes from #10675.
Minimal Reproduction
from pydantic import ValidationError, BaseModel
from devtools import debug
from pydantic.json_schema import GenerateJsonSchema
from pydantic_core import SchemaValidator, core_schema
class Model(BaseModel):
a: int
b: int
schema = core_schema.model_schema(
Model,
core_schema.model_fields_schema(
{
'a': core_schema.model_field(core_schema.int_schema()),
'b': core_schema.model_field(core_schema.int_schema()),
},
),
extra_behavior='forbid',
)
json_schema = GenerateJsonSchema().generate(schema)
debug(json_schema)
"""
json_schema: {
'properties': {
'a': {
'title': 'A',
'type': 'integer',
},
'b': {
'title': 'B',
'type': 'integer',
},
},
'required': ['a', 'b'],
'title': 'Model',
'type': 'object',
}
"""
Environment
- Pydantic: 2
What Broke
Users experienced unexpected validation errors when using TypedDicts with additional properties.
Why It Broke
The default behavior for TypedDicts and dataclasses regarding additional properties in JSON schema was inconsistent
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==2.12.0
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/12179
First fixed release: 2.12.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix is not applicable if you require TypedDicts to allow additional properties.
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.12.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.