Jump to solution
Verify

The Fix

pip install pydantic==1.10.19

Based on closed pydantic/pydantic issue #11853 · 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
@@ -767,6 +767,12 @@ def _unpack_refs_defs(self, schema: CoreSchema) -> CoreSchema: return schema + def _resolve_self_type(self, obj: Any) -> Any: + obj = self.model_type_stack.get() + if obj is None:
repro.py
class Endpoint(BaseModel): endpoint_func: Callable input_schema: INPUT_SCHEMA output_schema: OUTPUT_SCHEMA @field_validator("output_schema", mode="plain") @classmethod def validate_output_schema(cls, v: OUTPUT_SCHEMA) -> OUTPUT_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==1.10.19\nWhen NOT to use: This fix should not be applied if the code relies on the deprecated behavior of type subscripting.\n\n

Why This Fix Works in Production

  • Trigger: pydantic.errors.PydanticUserError: Subscripting `type[]` with an already parametrized type is not supported. Instead of using…
  • Mechanism: Addresses issues related to the usage of `type` with `typing.Self` and type aliases, fixing errors that arose from subscripting `type[]` with already parametrized types.
  • Why the fix works: Addresses issues related to the usage of `type` with `typing.Self` and type aliases, fixing errors that arose from subscripting `type[]` with already parametrized types. (first fixed release: 1.10.19).
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

  • Surfaces as: pydantic.errors.PydanticUserError: Subscripting `type[]` with an already parametrized type is not supported. Instead of using type[typing.Sequence[pydantic.main.BaseModel]], use…

Proof / Evidence

Discussion

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

“typing.Sequence is a deprecated alias to collections.abc.Sequence. This alias is implemented as an instance of an internal typing construct and as such doesn't pass the…”
@Viicos · 2025-05-15 · source
“@Viicos Thanks for the quick reply! I applied your suggestions - removed SkipValidation and changed the validators to "plain"”
@JanSobus · 2025-05-11 · source
“An extra check was introduced in 2.10 by https://github.com/pydantic/pydantic/pull/10621”
@Viicos · 2025-05-09 · source

Failure Signature (Search String)

  • pydantic.errors.PydanticUserError: Subscripting `type[]` with an already parametrized type is not supported. Instead of using type[typing.Sequence[pydantic.main.BaseModel]], use

Error Message

Stack trace
error.txt
Error Message ------------- pydantic.errors.PydanticUserError: Subscripting `type[]` with an already parametrized type is not supported. Instead of using type[typing.Sequence[pydantic.main.BaseModel]], use type[Sequence].

Minimal Reproduction

repro.py
class Endpoint(BaseModel): endpoint_func: Callable input_schema: INPUT_SCHEMA output_schema: OUTPUT_SCHEMA @field_validator("output_schema", mode="plain") @classmethod def validate_output_schema(cls, v: OUTPUT_SCHEMA) -> OUTPUT_SCHEMA: ...

Environment

  • Pydantic: 2

What Broke

Users experienced type errors when defining models that previously worked in version 2.9.

Fix Options (Details)

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

pip install pydantic==1.10.19

When NOT to use: This fix should not be applied if the code relies on the deprecated behavior of type subscripting.

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

First fixed release: 1.10.19

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 should not be applied if the code relies on the deprecated behavior of type subscripting.

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

Related Issues

No related fixes found.

Sources

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