Jump to solution
Details

The Fix

Expands the benchmark suite by adding schema generation benchmarks for models with custom field and model validators.

Based on closed pydantic/pydantic issue #9711 · PR/commit linked

Open PR/Commit
@@ -1,9 +1,19 @@ @@ -1,9 +1,19 @@ -from typing import Dict, Generic, List, Literal, Optional, TypeVar, Union, get_origin +from typing import Any, Dict, Generic, List, Literal, Optional, TypeVar, Union, get_origin
fix.md
Option A — Apply the official fix\nExpands the benchmark suite by adding schema generation benchmarks for models with custom field and model validators.\nWhen NOT to use: This fix should not be used if existing benchmarks are sufficient for performance evaluation.\n\n

Why This Fix Works in Production

  • Trigger: I wouldn't say these are necessary to close this issue, but one thing for more involved contributors to look at would be benchmarking specific parts of our…
  • Mechanism: The benchmark suite lacked coverage for core schema generation in Pydantic

Why This Breaks in Prod

  • The benchmark suite lacked coverage for core schema generation in Pydantic
  • Production symptom (often without a traceback): I wouldn't say these are necessary to close this issue, but one thing for more involved contributors to look at would be benchmarking specific parts of our core schema generation process in `pydantic`, such as:

Proof / Evidence

Discussion

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

“Alright, I've designed some more helpful criteria here re how we can close this issue”
@sydney-runkle · 2024-08-27 · source
“Do you have a plan on what general areas we want to focus on increasing benchmark coverage? (i.e. serialization, deserialization, import, validation, etc)”
@siavashyj · 2024-07-23 · source
“Any of these would be great”
@sydney-runkle · 2024-07-24 · source
“This probably needs more specific acceptance criteria - when are we done with this?”
@sydney-runkle · 2024-07-31 · source

Failure Signature (Search String)

  • I wouldn't say these are necessary to close this issue, but one thing for more involved contributors to look at would be benchmarking specific parts of our core schema generation
  • - [ ] schema cleaning (including defs / refs simplification)
Copy-friendly signature
signature.txt
Failure Signature ----------------- I wouldn't say these are necessary to close this issue, but one thing for more involved contributors to look at would be benchmarking specific parts of our core schema generation process in `pydantic`, such as: - [ ] schema cleaning (including defs / refs simplification)

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- I wouldn't say these are necessary to close this issue, but one thing for more involved contributors to look at would be benchmarking specific parts of our core schema generation process in `pydantic`, such as: - [ ] schema cleaning (including defs / refs simplification)

What Broke

Insufficient benchmark coverage may lead to performance regressions in schema generation.

Why It Broke

The benchmark suite lacked coverage for core schema generation in Pydantic

Fix Options (Details)

Option A — Apply the official fix

Expands the benchmark suite by adding schema generation benchmarks for models with custom field and model validators.

When NOT to use: This fix should not be used if existing benchmarks are sufficient for performance evaluation.

Fix reference: https://github.com/pydantic/pydantic/pull/10271

Last verified: 2026-02-12. 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 used if existing benchmarks are sufficient for performance evaluation.

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.

Related Issues

No related fixes found.

Sources

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