koxudaxi
datamodel-code-generator
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
Fix constr() for string fields carrying minItems/maxItems A pydantic v2 string field whose schema uses `minItems`/`maxItems` generated `constr(min_items=..., max_items=...)`. `constr` has no `min_items`/`max_items` parameters (those are `min_length`/`max_length`), so building the model raises `TypeError: constr() got an unexpected keyword argument 'min_items'`. Import appears to succeed only because `from __future__ import annotations` defers annotation evaluation; the error surfaces on first validation/instantiation. `minItems`/`maxItems` only ever reach the string constraint path (`string_kwargs`), and the Field path (`validate_min_max_items`) and the msgspec path already normalize them to length constraints for strings. Map them to `min_length`/`max_length` so the `constr()` path is consistent and the generated model is usable. Add a regression test and fixture. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
trail-of-forks:fix-constr-string-length
2 minutes ago
refactor: deduplicate import reference helpers (#3348)
main
21 minutes ago
Refactor pydantic v2 config generation
refactor/pydantic-v2-config-dedup
27 minutes ago
Refactor builtin formatter into shimmed module
refactor/builtin-formatter
28 minutes ago
Refactor XML Schema literal helpers
refactor/xmlschema-literals
39 minutes ago
Refactor jsonschema root model registration
refactor/jsonschema-root-model-helper
40 minutes ago
Refactor run_generate_from_config forwarding
refactor/main-module-helpers
51 minutes ago
Refactor pydantic v2 config generation
refactor/pydantic-v2-config-dedup
1 hour ago
Latest Branches
CodSpeed Performance Gauge
+13%
Fix `constr()` for string fields carrying minItems/maxItems
#3353
1 hour ago
f594e26
trail-of-forks:fix-constr-string-length
CodSpeed Performance Gauge
0%
Deduplicate Pydantic v2 config helpers
#3350
2 hours ago
bed2766
refactor/pydantic-v2-config-dedup
CodSpeed Performance Gauge
+13%
Move builtin formatter helpers
#3351
2 hours ago
3060c95
refactor/builtin-formatter
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs