Skip to content

Commit 134c7c2

Browse files
docs: update CHANGELOG.md for 0.46.0
1 parent 95736ad commit 134c7c2

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,57 @@ All notable changes to this project are documented in this file.
44
This changelog is automatically generated from GitHub Releases.
55

66
---
7+
## [0.46.0](https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.46.0) - 2025-12-20
8+
9+
## Breaking Changes
10+
11+
### Python Version
12+
* Python 3.9 support dropped - Minimum Python version is now 3.10+ (#2692)
13+
14+
### Default Behavior Changes
15+
* Native type hints by default - `list[...]`/`dict[...]` are now used instead of `List[...]`/`Dict[...]`. Use `--no-use-standard-collections` to restore previous behavior (#2699)
16+
* Union operator by default - `X | Y` syntax is now used instead of `Union[X, Y]`/`Optional[X]`. Use `--no-use-union-operator` to restore previous behavior (#2703)
17+
18+
### Code Generation Changes
19+
* Nullable required fields no longer have default values (Pydantic v2) - Fields marked as both `required` and `nullable` no longer get `= None`. The `pydantic_v2/BaseModel.jinja2` template logic was updated to only assign default values when `field.required` is false. This fixes incorrect behavior where required fields could be omitted (#2520)
20+
* TypedDict respects enum_field_as_literal setting - TypedDict output now respects user's `--enum-field-as-literal` setting instead of forcing `all`. Added new `--enum-field-as-literal none` option (#2691)
21+
* prefixItems now generates tuple types - JSON Schema `prefixItems` with matching `minItems`/`maxItems` and no `items` now generates `tuple[T1, T2, ...]` instead of `list[...]`. This applies when the array has a fixed length with heterogeneous types (#2537)
22+
23+
24+
## What's Changed
25+
* feat: Add --use-status-code-in-response-name option by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2688
26+
* feat: Add support for number type with time-delta format by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2689
27+
* docs: Add CHANGELOG.md with auto-update workflow by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2690
28+
* feat: Add --enum-field-as-literal none option and respect user settings for TypedDict by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2691
29+
* docs: Clarify default encoding behavior in documentation by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2693
30+
* ci: Improve CLI docs generation workflow by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2695
31+
* feat(docs): Group CLI examples by schema type with tabs by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2696
32+
* feat: Add --ignore-enum-constraints option by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2694
33+
* Add zensical.toml configuration by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2697
34+
* fix: Make docs generation deterministic by sorting glob results and dict iterations by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2698
35+
* feat: Drop Python 3.9 support, require Python 3.10+ by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2692
36+
* fix: Update zensical dependency version to 0.0.13 for Python 3.10+ by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2700
37+
* feat: Default to native list/dict type hints instead of typing.List/Dict by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2699
38+
* fix: Remove unnecessary pass statement when nested class exists by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2704
39+
* build: Replace pre-commit with prek by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2702
40+
* fix: Improve state management in Imports, DataType, and DataModel classes by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2705
41+
* feat: Default to union operator for type hints by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2703
42+
* fix: handle fork PRs in lint workflow by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2706
43+
* fix: handle fork PRs in readme and cli-docs workflows by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2707
44+
* Nullable required fields should not have default value by @raymondbutcher in https://github.com/koxudaxi/datamodel-code-generator/pull/2520
45+
* Add support for prefixItems to emit tuples by @saulshanabrook in https://github.com/koxudaxi/datamodel-code-generator/pull/2537
46+
* Remove unnecessary flags from --check test by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2708
47+
* fix: update expected files to use modern union type syntax (`str | None`) by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2709
48+
* fix: trigger docs build after changelog update by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2710
49+
50+
## New Contributors
51+
* @raymondbutcher made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/2520
52+
* @saulshanabrook made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/2537
53+
54+
**Full Changelog**: https://github.com/koxudaxi/datamodel-code-generator/compare/0.45.0...0.46.0
55+
56+
---
57+
758

859
## [0.45.0](https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.45.0) - 2025-12-19
960

0 commit comments

Comments
 (0)