The Fix
pip install pydantic==2.6.2
Based on closed pydantic/pydantic issue #8771 · 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%.
@@ -59,7 +59,9 @@ types:
* `str`; the following formats are accepted:
* `YYYY-MM-DD[T]HH:MM[:SS[.ffffff]][Z or [±]HH[:]MM]`
+ * `YYYY-MM-DD` is accepted in lax mode, but not in strict mode
* `int` or `float` as a string (assumed as Unix time)
+ * [`datetime.date`][] instances are accepted in lax mode, but not in strict mode
Option A — Upgrade to fixed release\npip install pydantic==2.6.2\nWhen NOT to use: This fix is not applicable if the documentation does not require clarification for other types.\n\n
Why This Fix Works in Production
- Trigger: This was probably missed during the [v1 -> v2 migration](https://docs.pydantic.dev/latest/migration/#changes-to-pydanticfield)
- Mechanism: Documentation did not clarify that min_length and max_length apply to iterables
- Why the fix works: Updated documentation to clarify that min_length and max_length apply to iterables. (first fixed release: 2.6.2).
- 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
- Documentation did not clarify that min_length and max_length apply to iterables
- Production symptom (often without a traceback): This was probably missed during the [v1 -> v2 migration](https://docs.pydantic.dev/latest/migration/#changes-to-pydanticfield)
Proof / Evidence
- GitHub issue: #8771
- Fix PR: https://github.com/pydantic/pydantic/pull/8824
- First fixed release: 2.6.2
- 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.63
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Yes! @straygar iterable is more inclusive as then it is implied it works for ANY iterable (tuples, dicts, etc.)”
“@straygar, You're correct, thanks for catching this! Could you please open a PR with a fix? I'd be happy to review your changes.”
“Sure! I guess this also applies to sets and bytes? What'd be a good generic text? Do we even want to specify types here?”
“@straygar you can use "iterable" as a catch all term here. Thanks!”
Failure Signature (Search String)
- This was probably missed during the [v1 -> v2 migration](https://docs.pydantic.dev/latest/migration/#changes-to-pydanticfield)
- You're correct, thanks for catching this! Could you please open a PR with a fix? I'd be happy to review your changes.
Copy-friendly signature
Failure Signature
-----------------
This was probably missed during the [v1 -> v2 migration](https://docs.pydantic.dev/latest/migration/#changes-to-pydanticfield)
You're correct, thanks for catching this! Could you please open a PR with a fix? I'd be happy to review your changes.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
This was probably missed during the [v1 -> v2 migration](https://docs.pydantic.dev/latest/migration/#changes-to-pydanticfield)
You're correct, thanks for catching this! Could you please open a PR with a fix? I'd be happy to review your changes.
Environment
- Pydantic: 2
What Broke
Users were misled by documentation, leading to incorrect usage of field parameters.
Why It Broke
Documentation did not clarify that min_length and max_length apply to iterables
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==2.6.2
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/8824
First fixed release: 2.6.2
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix is not applicable if the documentation does not require clarification for other types.
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 |
|---|---|
| 2.6.2 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.