Jump to solution
Verify

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.

Jump to Verify Open PR/Commit
@@ -62,7 +62,12 @@ from ..json_schema import JsonSchemaValue from ..version import version_short -from ..warnings import ArbitraryTypeWarning, PydanticDeprecatedSince20, UnsupportedFieldAttributeWarning +from ..warnings import ( + ArbitraryTypeWarning,
repro.py
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', } """
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
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).
Production impact:
  • 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

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.”
@samuelcolvin · 2024-11-07 · source
“@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”
@edgarrmondragon · 2025-08-20 · source
“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…”
@sydney-runkle · 2024-11-07 · source
“We can chat about final behavior in our oss sync this morning 👍”
@sydney-runkle · 2024-11-07 · source

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
signature.txt
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.txt
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

repro.py
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

When NOT to use: This fix is not applicable if you require TypedDicts to allow additional properties.

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.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix is not applicable if you require TypedDicts to allow additional properties.

Verify Fix

verify
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

VersionStatus
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.