Jump to solution
Verify

The Fix

pip install pydantic==1.10.18

Based on closed pydantic/pydantic issue #9997 · 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%.

Jump to Verify Open PR/Commit
@@ -324,6 +324,7 @@ def __init__( has_dynamic_alias: bool, has_default: bool, + strict: bool | None, line: int, column: int,
repro.py
class Model(BaseModel): a: int b: int = Field(strict=True) c: int = Field(strict=False) # expected mypy error: b Model(a='1', b='2', c='3') class ModelStrictMode(BaseModel): model_config = {'strict': True} a: int b: int = Field(strict=True) c: int = Field(strict=False) # expected mypy error: a, b ModelStrictMode(a='1', b='2', c='3')
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==1.10.18\nWhen NOT to use: Do not use this fix if strict type checking is not desired for your models.\n\n

Why This Fix Works in Production

  • Trigger: - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
  • Mechanism: The mypy plugin did not enforce strict type checking for fields with strict validation
  • Why the fix works: Applies `strict=True` to `__init__` in the mypy plugin, ensuring type annotations for fields with strict validation are enforced even when `init_typed` is set to false. (first fixed release: 1.10.18).
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 mypy plugin did not enforce strict type checking for fields with strict validation
  • Production symptom (often without a traceback): - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)

Proof / Evidence

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“I think this makes sense, the main concern I have @sydney-runkle is that we need to make sure this doesn’t affect anyone that hasn’t opted…”
@dmontagu · 2024-07-30 · source

Failure Signature (Search String)

  • - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
  • - [ ] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)
Copy-friendly signature
signature.txt
Failure Signature ----------------- - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/) - [ ] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/) - [ ] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)

Minimal Reproduction

repro.py
class Model(BaseModel): a: int b: int = Field(strict=True) c: int = Field(strict=False) # expected mypy error: b Model(a='1', b='2', c='3') class ModelStrictMode(BaseModel): model_config = {'strict': True} a: int b: int = Field(strict=True) c: int = Field(strict=False) # expected mypy error: a, b ModelStrictMode(a='1', b='2', c='3')

What Broke

Users experienced unexpected type errors when using strict validation in models.

Why It Broke

The mypy plugin did not enforce strict type checking for fields with strict validation

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install pydantic==1.10.18

When NOT to use: Do not use this fix if strict type checking is not desired for your models.

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/9998

First fixed release: 1.10.18

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

  • Do not use this fix if strict type checking is not desired for your models.

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