Jump to solution
Verify

The Fix

pip install pydantic==2.6.1

Based on closed pydantic/pydantic issue #8649 · 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
@@ -479,14 +479,18 @@ def __get_pydantic_core_schema__( ) -> core_schema.CoreSchema: import_email_validator() + return core_schema.no_info_after_validator_function( cls._validate,
repro.py
import pydantic class Model(BaseModel): v: NameEmail Model.model_validate_json('{"v":{"name":"foo bar","email":"[email protected]"}}') Model.model_validate_json('{"v":"foo bar <[email protected]>"}')
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.6.1\nWhen NOT to use: Do not use this fix if you require backward compatibility with previous versions of `NameEmail`.\n\n

Why This Fix Works in Production

  • Trigger: NotImplementedError: Cannot check isinstance when validating from json, use a JsonOrPython validator instead.
  • Mechanism: The `NameEmail` type does not support JSON deserialization, causing validation errors
  • Why the fix works: Fixes json validation for `NameEmail` type, allowing it to parse from JSON input. (first fixed release: 2.6.1).
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 `NameEmail` type does not support JSON deserialization, causing validation errors
  • Surfaces as: NotImplementedError: Cannot check isinstance when validating from json, use a JsonOrPython validator instead.

Proof / Evidence

Discussion

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

“@Holi0317, Ah yes, thanks for reporting this. Thanks a bunch for contributing a fix. I'll review your PR later today :). Great work!”
@sydney-runkle · 2024-01-29 · source

Failure Signature (Search String)

  • NotImplementedError: Cannot check isinstance when validating from json, use a JsonOrPython validator instead.

Error Message

Stack trace
error.txt
Error Message ------------- NotImplementedError: Cannot check isinstance when validating from json, use a JsonOrPython validator instead.

Minimal Reproduction

repro.py
import pydantic class Model(BaseModel): v: NameEmail Model.model_validate_json('{"v":{"name":"foo bar","email":"[email protected]"}}') Model.model_validate_json('{"v":"foo bar <[email protected]>"}')

Environment

  • Pydantic: 2

What Broke

Validating JSON input with `NameEmail` raises a NotImplementedError, leading to failed requests.

Why It Broke

The `NameEmail` type does not support JSON deserialization, causing validation errors

Fix Options (Details)

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

pip install pydantic==2.6.1

When NOT to use: Do not use this fix if you require backward compatibility with previous versions of `NameEmail`.

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

First fixed release: 2.6.1

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 you require backward compatibility with previous versions of `NameEmail`.

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

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.