Jump to solution
Verify

The Fix

pip install pydantic==2.11.8

Based on closed pydantic/pydantic issue #9057 · 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
@@ -501,3 +501,49 @@ args, kwargs = val.validate_json('{"args": ["arg1"], "kwargs": {"extra": 1}}') #> ('arg1',) {'extra': 1} ``` + +## `MISSING` sentinel +
repro.py
import json from typing import NotRequired from pydantic import TypeAdapter from typing_extensions import TypedDict class Cell(TypedDict): name: str type: str organism: NotRequired[str] ta = TypeAdapter(Cell) print(json.dumps(ta.json_schema()))
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.11.8\nWhen NOT to use: Do not use this fix if you need strict validation without optional fields.\n\n

Why This Fix Works in Production

  • Trigger: Pydantic to JSON Schema translation: Write a field with no default value that is not required in the JSON schema
  • Mechanism: The Pydantic model requires default values for fields to be excluded from JSON schema requirements
  • Why the fix works: Introduced an experimental `MISSING` sentinel to allow fields without default values to be excluded from JSON schema requirements. (first fixed release: 2.11.8).
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 Pydantic model requires default values for fields to be excluded from JSON schema requirements
  • Production symptom (often without a traceback): Pydantic to JSON Schema translation: Write a field with no default value that is not required in the JSON schema

Proof / Evidence

Discussion

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

“#8394 is similar, but I'm referring here specifically to the JSON schema generator”
@mettaMeddl · 2024-03-19 · source
“Maybe TypedDict is what you need. **JSON Schema**:”
@dominik-schwabe · 2024-05-06 · source
“A new MISSING sentinel was introduced in https://github.com/pydantic/pydantic/pull/11883 as an experimental feature, and available to be tested in the 2.12.0a1 release”
@Viicos · 2025-07-26 · source

Failure Signature (Search String)

  • Pydantic to JSON Schema translation: Write a field with no default value that is not required in the JSON schema
  • Consider the following schema:
Copy-friendly signature
signature.txt
Failure Signature ----------------- Pydantic to JSON Schema translation: Write a field with no default value that is not required in the JSON schema Consider the following schema:

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- Pydantic to JSON Schema translation: Write a field with no default value that is not required in the JSON schema Consider the following schema:

Minimal Reproduction

repro.py
import json from typing import NotRequired from pydantic import TypeAdapter from typing_extensions import TypedDict class Cell(TypedDict): name: str type: str organism: NotRequired[str] ta = TypeAdapter(Cell) print(json.dumps(ta.json_schema()))

Environment

  • Pydantic: 2.6.4

What Broke

Users cannot create optional fields in JSON schema without default values, leading to incorrect form behavior.

Why It Broke

The Pydantic model requires default values for fields to be excluded from JSON schema requirements

Fix Options (Details)

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

pip install pydantic==2.11.8

When NOT to use: Do not use this fix if you need strict validation without optional fields.

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

First fixed release: 2.11.8

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 need strict validation without optional fields.

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

Related Issues

No related fixes found.

Sources

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