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%.
@@ -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:
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:
...
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
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).
- 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
- GitHub issue: #11853
- Fix PR: https://github.com/pydantic/pydantic/pull/10621
- First fixed release: 1.10.19
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.62
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 Thanks for the quick reply! I applied your suggestions - removed SkipValidation and changed the validators to "plain"”
“An extra check was introduced in 2.10 by https://github.com/pydantic/pydantic/pull/10621”
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 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
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
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.
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
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
| Version | Status |
|---|---|
| 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.