{
 "stale check": 1,
 "build": 0,
 "check": 0,
 "range pages": 0,
 "raw site": 0,
 "has breaking 0.4.0": 0,
 "has breaking 0.1.0": 1
}
=== release notes 0.2.0 (exit 0) ===
## Breaking Changes

### Code Generation Changes
* String enums become `StrEnum` - Enums of strings subclass `StrEnum` instead of `Enum`. Keep the old output with `--no-use-specialized-enum`. (#2512)
* Models of `anyOf` members lose the `Item` suffix - Models of `anyOf` and `oneOf` members no longer end in `Item`. No option restores the old names; `--model-name-map` can pin individual names. (#1682)

### Python Version Changes
* datamodel-code-generator no longer runs on Python 3.7 - Install and run the generator on Python 3.8 or newer. Use Python 3.8 or newer. (#2060)

## Deprecations

* `--validation` now emits `DeprecationWarning`. Planned removal: 0.4.0. --validation is deprecated.

## New Dated Presets

* `standard-py3XX-20260101` and `practical-py3XX-20260101`: The first dated presets; the [presets page](https://datamodel-code-generator.koxudaxi.dev/presets/) lists their options.

=== release notes 0.3.0 (exit 0) ===
## Breaking Changes

### Code Generation Changes
* Constraints move into `Annotated` - With `--use-annotated`, constraints are written in `Annotated`. Keep the old output with `--field-constraints`. (#3001)
* `format: date-time` becomes `AwareDatetime` - A timestamp without a UTC offset is rejected. Keep the old output with `--output-datetime-class datetime`. (#1735)

### API/CLI Changes
* `generate_dynamic_models()` no longer formats the code it builds - It skips Black and isort unless formatters are selected. Pass `formatters=[Formatter.BLACK, Formatter.ISORT]` in the config. (#6750)

### Python Version Changes
* datamodel-code-generator no longer runs on Python 3.8 - Install and run the generator on Python 3.9 or newer. Use Python 3.9 or newer. (#3003)

## Deprecations

* `PythonVersion.has_type_alias` now emits `DeprecationWarning`. Planned removal: TBD. has_type_alias is deprecated.

## New Warnings

* `--type-overrides` keys that match nothing emit a `UserWarning` - A key that names no generated model or field is reported; the output is unchanged. (#3004)

## New Options

* New value `b` of `--output-model-type`
* New option `--released-flag`

## New Dated Presets

* `standard-py3XX-20260201` and `practical-py3XX-20260201`: they keep the 20260101 options and add Python 3.15 targets; Strict types (`--strict-types str`): Be strict.

## Experimental Features

* `--input-file-type avro` is experimental. Avro input is experimental.

## Changes That Need No Action

* Class docstrings are wrapped - Long class docstrings are wrapped at the line length. (#3002)
* The warning of an unknown format names the field - The text of an existing warning changes; nothing else does. (#3005)

=== release notes 0.4.0 (exit 0) ===
## Breaking Changes

### API/CLI Changes
* `--validation` is removed - --validation is deprecated. Use --field-constraints.

### Error Handling Changes
* An empty `enum` is refused - A schema with `enum: []` fails with an error instead of generating an empty enum. Drop the empty `enum` keyword. (#4002)

## Changes That Need No Action

* Class docstrings are no longer wrapped - The wrapping of 0.3.0 is undone. (#4001)

=== release notes unreleased (exit 0) ===
## Breaking Changes

### Custom Template Update Required
* Custom templates receive `fields` instead of `model_fields` - Templates of `--custom-template-dir` read the fields as `fields`. Rename `model_fields` to `fields` in your templates. (#5001)

### API/CLI Changes
* `--old-flag` is removed - The option did nothing since 0.3.0. Drop `--old-flag`. (#5002)

## Scheduled Breaking Changes

* `argcomplete installation` is registered without a runtime warning. Planned removal: TBD. argcomplete will become optional.

## New Options

* New option `--new-flag` (`--no-new-flag`): Turn on new things.
* New value `c` of `--output-model-type`
* New option `--quiet-flag`

## New Dated Presets

* `standard-py3XX-20260301` and `practical-py3XX-20260301`: they keep the 20260201 options and add Snake case (`--snake-case-field`): Snake case field names.

--- data/migration.json ---
{
 "changelog": "https://github.com/datamodel-code-generator/datamodel-code-generator/blob/main/CHANGELOG.md",
 "changes": [
  {
   "action": "required",
   "id": "python-37-runtime-dropped",
   "kind": "runtime",
   "migrate": "Use Python 3.8 or newer.",
   "refs": [
    "#2060"
   ],
   "release": "0.2.0",
   "source": "release-note",
   "summary": "Install and run the generator on Python 3.8 or newer.",
   "title": "datamodel-code-generator no longer runs on Python 3.7"
  },
  {
   "action": "keep",
   "affects": {
    "input_file_types": [
     "openapi",
     "jsonschema"
    ]
   },
   "after": "class Status(StrEnum):",
   "before": "class Status(Enum):",
   "id": "specialized-enum-default",
   "keep": {
    "flags": [
     "--no-use-specialized-enum"
    ]
   },
   "kind": "default-output",
   "refs": [
    "#2512"
   ],
   "release": "0.2.0",
   "source": "release-note",
   "summary": "Enums of strings subclass `StrEnum` instead of `Enum`.",
   "title": "String enums become `StrEnum`"
  },
  {
   "action": "review",
   "id": "union-item-suffix-removed",
   "keep": {
    "note": "No option restores the old names; `--model-name-map` can pin individual names."
   },
   "kind": "default-output",
   "refs": [
    "#1682"
   ],
   "release": "0.2.0",
   "source": "release-note",
   "summary": "Models of `anyOf` and `oneOf` members no longer end in `Item`.",
   "title": "Models of `anyOf` members lose the `Item` suffix"
  },
  {
   "action": "warn",
   "affects": {
    "options": [
     "--validation"
    ]
   },
   "id": "deprecation:cli.validation",
   "kind": "warning",
   "migrate": "Use --field-constraints.",
   "release": "0.2.0",
   "source": "registry",
   "summary": "--validation is deprecated.",
   "title": "--validation now emits DeprecationWarning"
  },
  {
   "action": "none",
   "id": "preset:20260101",
   "kind": "preset",
   "release": "0.2.0",
   "source": "registry",
   "summary": "The first dated presets; the [presets page](https://datamodel-code-generator.koxudaxi.dev/presets/) lists their options.",
   "title": "New dated presets `standard-py3XX-20260101` and `practical-py3XX-20260101`"
  },
  {
   "action": "required",
   "id": "python-38-runtime-dropped",
   "kind": "runtime",
   "migrate": "Use Python 3.9 or newer.",
   "refs": [
    "#3003"
   ],
   "release": "0.3.0",
   "source": "release-note",
   "summary": "Install and run the generator on Python 3.9 or newer.",
   "supersedes": [
    "python-37-runtime-dropped"
   ],
   "title": "datamodel-code-generator no longer runs on Python 3.8"
  },
  {
   "action": "keep",
   "affects": {
    "options": [
     "--use-annotated"
    ]
   },
   "id": "annotated-constraints",
   "keep": {
    "flags": [
     "--field-constraints"
    ]
   },
   "kind": "default-output",
   "refs": [
    "#3001"
   ],
   "release": "0.3.0",
   "source": "release-note",
   "summary": "With `--use-annotated`, constraints are written in `Annotated`.",
   "title": "Constraints move into `Annotated`"
  },
  {
   "action": "keep",
   "affects": {
    "output_model_types": [
     "pydantic_v2.BaseModel"
    ]
   },
   "id": "aware-datetime",
   "keep": {
    "flags": [
     "--output-datetime-class",
     "datetime"
    ]
   },
   "kind": "default-output",
   "refs": [
    "#1735"
   ],
   "release": "0.3.0",
   "source": "release-note",
   "summary": "A timestamp without a UTC offset is rejected.",
   "title": "`format: date-time` becomes `AwareDatetime`"
  },
  {
   "action": "keep",
   "affects": {
    "python_api": [
     "generate_dynamic_models"
    ]
   },
   "id": "dynamic-models-unformatted",
   "keep": {
    "note": "Pass `formatters=[Formatter.BLACK, Formatter.ISORT]` in the config."
   },
   "kind": "python-api",
   "refs": [
    "#6750"
   ],
   "release": "0.3.0",
   "source": "release-note",
   "summary": "It skips Black and isort unless formatters are selected.",
   "title": "`generate_dynamic_models()` no longer formats the code it builds"
  },
  {
   "action": "warn",
   "affects": {
    "python_api": [
     "PythonVersion.has_type_alias"
    ]
   },
   "id": "deprecation:python-api.python-version-has-type-alias",
   "kind": "warning",
   "release": "0.3.0",
   "source": "registry",
   "summary": "has_type_alias is deprecated.",
   "title": "PythonVersion.has_type_alias now emits DeprecationWarning"
  },
  {
   "action": "warn",
   "affects": {
    "options": [
     "--type-overrides"
    ]
   },
   "id": "unmatched-override-keys",
   "kind": "warning",
   "migrate": "Fix or drop the keys the warning names.",
   "refs": [
    "#3004"
   ],
   "release": "0.3.0",
   "source": "release-note",
   "summary": "A key that names no generated model or field is reported; the output is unchanged.",
   "title": "`--type-overrides` keys that match nothing emit a `UserWarning`"
  },
  {
   "action": "none",
   "id": "class-docstrings",
   "kind": "output-text",
   "refs": [
    "#3002"
   ],
   "release": "0.3.0",
   "source": "release-note",
   "summary": "Long class docstrings are wrapped at the line length.",
   "title": "Class docstrings are wrapped"
  },
  {
   "action": "none",
   "affects": {
    "experimental": [
     "input-format.avro"
    ]
   },
   "id": "experimental:input-format.avro",
   "kind": "experimental",
   "release": "0.3.0",
   "source": "registry",
   "summary": "Avro input is experimental.",
   "title": "--input-file-type avro is experimental"
  },
  {
   "action": "none",
   "id": "option:--output-model-type=b",
   "kind": "cli",
   "migrate": "Pass `--output-model-type b` for kind b models.",
   "release": "0.3.0",
   "source": "surface",
   "summary": "Writes models of kind b.",
   "title": "New value `b` of `--output-model-type`"
  },
  {
   "action": "none",
   "id": "option:--released-flag",
   "kind": "cli",
   "release": "0.3.0",
   "source": "surface",
   "summary": "New option `--released-flag`.",
   "title": "New option `--released-flag`"
  },
  {
   "action": "none",
   "id": "preset:20260201",
   "kind": "preset",
   "release": "0.3.0",
   "source": "registry",
   "summary": "They keep the options of the 20260101 presets and add:\n\n- Python 3.15 targets\n- Strict types (`--strict-types str`): Be strict.",
   "title": "New dated presets `standard-py3XX-20260201` and `practical-py3XX-20260201`"
  },
  {
   "action": "none",
   "id": "quiet-warning-text",
   "kind": "warning",
   "refs": [
    "#3005"
   ],
   "release": "0.3.0",
   "source": "release-note",
   "summary": "The text of an existing warning changes; nothing else does.",
   "title": "The warning of an unknown format names the field"
  },
  {
   "action": "required",
   "id": "refuse-empty-enum",
   "kind": "error",
   "migrate": "Drop the empty `enum` keyword.",
   "refs": [
    "#4002"
   ],
   "release": "0.4.0",
   "source": "release-note",
   "summary": "A schema with `enum: []` fails with an error instead of generating an empty enum.",
   "title": "An empty `enum` is refused"
  },
  {
   "action": "required",
   "affects": {
    "options": [
     "--validation"
    ]
   },
   "id": "removal:cli.validation",
   "kind": "removal",
   "migrate": "Use --field-constraints.",
   "release": "0.4.0",
   "source": "registry",
   "summary": "--validation is deprecated.",
   "title": "`--validation` is removed"
  },
  {
   "action": "none",
   "id": "docstrings-unwrapped",
   "kind": "output-text",
   "refs": [
    "#4001"
   ],
   "release": "0.4.0",
   "reverts": "class-docstrings",
   "source": "release-note",
   "summary": "The wrapping of 0.3.0 is undone.",
   "title": "Class docstrings are no longer wrapped"
  },
  {
   "action": "required",
   "affects": {
    "templates": [
     "pydantic_v2/BaseModel.jinja2",
     "Old.jinja2"
    ]
   },
   "id": "custom-template-root",
   "kind": "template",
   "migrate": "Rename `model_fields` to `fields` in your templates.",
   "refs": [
    "#5001"
   ],
   "release": "unreleased",
   "source": "release-note",
   "summary": "Templates of `--custom-template-dir` read the fields as `fields`.",
   "title": "Custom templates receive `fields` instead of `model_fields`"
  },
  {
   "action": "required",
   "affects": {
    "options": [
     "--old-flag"
    ]
   },
   "id": "old-flag-removed",
   "kind": "removal",
   "migrate": "Drop `--old-flag`.",
   "refs": [
    "#5002"
   ],
   "release": "unreleased",
   "source": "release-note",
   "summary": "The option did nothing since 0.3.0.",
   "title": "`--old-flag` is removed"
  },
  {
   "action": "none",
   "id": "deprecation:dependency.argcomplete-optional",
   "kind": "warning",
   "release": "unreleased",
   "source": "registry",
   "summary": "argcomplete will become optional.",
   "title": "argcomplete installation is scheduled to change"
  },
  {
   "action": "none",
   "id": "option:--new-flag",
   "kind": "cli",
   "release": "unreleased",
   "source": "surface",
   "summary": "Turn on new things.",
   "title": "New option `--new-flag` (`--no-new-flag`)"
  },
  {
   "action": "none",
   "id": "option:--output-model-type=c",
   "kind": "cli",
   "release": "unreleased",
   "source": "surface",
   "summary": "New value `c` of `--output-model-type`.",
   "title": "New value `c` of `--output-model-type`"
  },
  {
   "action": "none",
   "id": "option:--quiet-flag",
   "kind": "cli",
   "release": "unreleased",
   "source": "surface",
   "summary": "New option `--quiet-flag`.",
   "title": "New option `--quiet-flag`"
  },
  {
   "action": "none",
   "id": "preset:20260301",
   "kind": "preset",
   "release": "unreleased",
   "source": "registry",
   "summary": "They keep the options of the 20260201 presets and add:\n\n- Snake case (`--snake-case-field`): Snake case field names.",
   "title": "New dated presets `standard-py3XX-20260301` and `practical-py3XX-20260301`"
  }
 ],
 "complete_from": "0.2.0",
 "latest": "0.4.0",
 "ranges": [
  {
   "changes": [
    "specialized-enum-default",
    "union-item-suffix-removed",
    "deprecation:cli.validation",
    "preset:20260101",
    "python-38-runtime-dropped",
    "annotated-constraints",
    "aware-datetime",
    "dynamic-models-unformatted",
    "deprecation:python-api.python-version-has-type-alias",
    "unmatched-override-keys",
    "experimental:input-format.avro",
    "option:--output-model-type=b",
    "option:--released-flag",
    "preset:20260201",
    "quiet-warning-text",
    "refuse-empty-enum",
    "removal:cli.validation"
   ],
   "complete": false,
   "from": "0.1.0",
   "keep_conditional": {
    "--use-annotated": [
     "--field-constraints"
    ]
   },
   "keep_flags": [
    "--no-use-specialized-enum",
    "--output-datetime-class",
    "datetime"
   ],
   "keep_pyproject": {
    "output-datetime-class": "datetime",
    "use-specialized-enum": false
   },
   "page": "https://datamodel-code-generator.koxudaxi.dev/migration/from-0.1.0/",
   "sources": [
    "0.1.0"
   ],
   "through": "0.1.0"
  },
  {
   "changes": [
    "python-38-runtime-dropped",
    "annotated-constraints",
    "aware-datetime",
    "dynamic-models-unformatted",
    "deprecation:python-api.python-version-has-type-alias",
    "unmatched-override-keys",
    "experimental:input-format.avro",
    "option:--output-model-type=b",
    "option:--released-flag",
    "preset:20260201",
    "quiet-warning-text",
    "refuse-empty-enum",
    "removal:cli.validation"
   ],
   "complete": true,
   "from": "0.2.0",
   "keep_conditional": {
    "--use-annotated": [
     "--field-constraints"
    ]
   },
   "keep_flags": [
    "--output-datetime-class",
    "datetime"
   ],
   "keep_pyproject": {
    "output-datetime-class": "datetime"
   },
   "page": "https://datamodel-code-generator.koxudaxi.dev/migration/from-0.2.0/",
   "sources": [
    "0.2.0"
   ],
   "through": "0.2.0"
  },
  {
   "changes": [
    "refuse-empty-enum",
    "removal:cli.validation",
    "docstrings-unwrapped"
   ],
   "complete": true,
   "from": "0.3.0",
   "keep_conditional": {},
   "keep_flags": [],
   "keep_pyproject": {},
   "page": "https://datamodel-code-generator.koxudaxi.dev/migration/from-0.3.0/",
   "sources": [
    "0.3.0"
   ],
   "through": "0.3.0"
  }
 ],
 "raw_page": "https://datamodel-code-generator.koxudaxi.dev/migration/from/{release}.md",
 "releases": [
  {
   "date": "2026-01-01",
   "version": "0.1.0"
  },
  {
   "date": "2026-02-01",
   "version": "0.2.0"
  },
  {
   "date": "2026-03-01",
   "version": "0.3.0"
  },
  {
   "date": "2026-04-01",
   "version": "0.4.0"
  }
 ],
 "schema_version": 1
}
--- migration/changes.md ---
# All Changes by Release

<!-- Generated by scripts/build_migration_docs.py. Do not edit manually. -->

Every change a user meets when upgrading, newest first. To upgrade from a release, apply every section above it, or open [the page for your release](index.md).

## Unreleased

### Custom templates receive `fields` instead of `model_fields` (unreleased) { #custom-template-root }

Templates of `--custom-template-dir` read the fields as `fields`.

- **Affects:** custom templates: `pydantic_v2/BaseModel.jinja2`, `Old.jinja2`
- **What to change:** Rename `model_fields` to `fields` in your templates.
- **Pull requests and issues:** [#5001](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/5001)
- **Source:** the release notes

### `--old-flag` is removed (unreleased) { #old-flag-removed }

The option did nothing since 0.3.0.

- **Affects:** only with: `--old-flag`
- **What to change:** Drop `--old-flag`.
- **Pull requests and issues:** [#5002](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/5002)
- **Source:** the release notes

### argcomplete installation is scheduled to change (unreleased) { #deprecation-dependency-argcomplete-optional }

argcomplete will become optional.

- **Source:** the registry of deprecations, experimental features and dated presets

### New option `--new-flag` (`--no-new-flag`) (unreleased) { #option-new-flag }

Turn on new things.

- **Source:** the command-line options of both releases

### New value `c` of `--output-model-type` (unreleased) { #option-output-model-type-c }

New value `c` of `--output-model-type`.

- **Source:** the command-line options of both releases

### New option `--quiet-flag` (unreleased) { #option-quiet-flag }

New option `--quiet-flag`.

- **Source:** the command-line options of both releases

### New dated presets `standard-py3XX-20260301` and `practical-py3XX-20260301` (unreleased) { #preset-20260301 }

They keep the options of the 20260201 presets and add:

- Snake case (`--snake-case-field`): Snake case field names.

- **Source:** the registry of deprecations, experimental features and dated presets

## 0.4.0 (2026-04-01)

### An empty `enum` is refused (0.4.0) { #refuse-empty-enum }

A schema with `enum: []` fails with an error instead of generating an empty enum.

- **What to change:** Drop the empty `enum` keyword.
- **Pull requests and issues:** [#4002](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/4002)
- **Source:** the release notes

### `--validation` is removed (0.4.0) { #removal-cli-validation }

--validation is deprecated.

- **Affects:** only with: `--validation`
- **What to change:** Use --field-constraints.
- **Source:** the registry of deprecations, experimental features and dated presets

### Class docstrings are no longer wrapped (0.4.0) { #docstrings-unwrapped }

The wrapping of 0.3.0 is undone.

- **Pull requests and issues:** [#4001](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/4001)
- **Source:** the release notes

## 0.3.0 (2026-03-01)

[Output changes in 0.3.0](../output-changes/0.3.0.md) compares the generated models.

### datamodel-code-generator no longer runs on Python 3.8 (0.3.0) { #python-38-runtime-dropped }

Install and run the generator on Python 3.9 or newer.

- **What to change:** Use Python 3.9 or newer.
- **Pull requests and issues:** [#3003](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3003)
- **Source:** the release notes

### Constraints move into `Annotated` (0.3.0) { #annotated-constraints }

With `--use-annotated`, constraints are written in `Annotated`.

- **Affects:** only with: `--use-annotated`
- **Keep the old output:** `--field-constraints`
- **Pull requests and issues:** [#3001](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3001)
- **Source:** the release notes

### `format: date-time` becomes `AwareDatetime` (0.3.0) { #aware-datetime }

A timestamp without a UTC offset is rejected.

- **Affects:** output model types: `pydantic_v2.BaseModel`
- **Keep the old output:** `--output-datetime-class datetime`
- **Pull requests and issues:** [#1735](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/1735)
- **Source:** the release notes

### `generate_dynamic_models()` no longer formats the code it builds (0.3.0) { #dynamic-models-unformatted }

It skips Black and isort unless formatters are selected.

- **Affects:** Python API: `generate_dynamic_models`
- **Keep the old output:** Pass `formatters=[Formatter.BLACK, Formatter.ISORT]` in the config.
- **Pull requests and issues:** [#6750](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/6750)
- **Source:** the release notes

### PythonVersion.has_type_alias now emits DeprecationWarning (0.3.0) { #deprecation-python-api-python-version-has-type-alias }

has_type_alias is deprecated.

- **Affects:** Python API: `PythonVersion.has_type_alias`
- **Source:** the registry of deprecations, experimental features and dated presets

### `--type-overrides` keys that match nothing emit a `UserWarning` (0.3.0) { #unmatched-override-keys }

A key that names no generated model or field is reported; the output is unchanged.

- **Affects:** only with: `--type-overrides`
- **What to change:** Fix or drop the keys the warning names.
- **Pull requests and issues:** [#3004](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3004)
- **Source:** the release notes

### Class docstrings are wrapped (0.3.0) { #class-docstrings }

Long class docstrings are wrapped at the line length.

- **Pull requests and issues:** [#3002](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3002)
- **Source:** the release notes

### --input-file-type avro is experimental (0.3.0) { #experimental-input-format-avro }

Avro input is experimental.

- **Affects:** experimental features: `input-format.avro`
- **Source:** the registry of deprecations, experimental features and dated presets

### New value `b` of `--output-model-type` (0.3.0) { #option-output-model-type-b }

Writes models of kind b.

- **What to change:** Pass `--output-model-type b` for kind b models.
- **Source:** the command-line options of both releases

### New option `--released-flag` (0.3.0) { #option-released-flag }

New option `--released-flag`.

- **Source:** the command-line options of both releases

### New dated presets `standard-py3XX-20260201` and `practical-py3XX-20260201` (0.3.0) { #preset-20260201 }

They keep the options of the 20260101 presets and add:

- Python 3.15 targets
- Strict types (`--strict-types str`): Be strict.

- **Source:** the registry of deprecations, experimental features and dated presets

### The warning of an unknown format names the field (0.3.0) { #quiet-warning-text }

The text of an existing warning changes; nothing else does.

- **Pull requests and issues:** [#3005](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3005)
- **Source:** the release notes

## 0.2.0 (2026-02-01)

### datamodel-code-generator no longer runs on Python 3.7 (0.2.0) { #python-37-runtime-dropped }

Install and run the generator on Python 3.8 or newer.

- **What to change:** Use Python 3.8 or newer.
- **Pull requests and issues:** [#2060](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/2060)
- **Source:** the release notes

### String enums become `StrEnum` (0.2.0) { #specialized-enum-default }

Enums of strings subclass `StrEnum` instead of `Enum`.

- **Affects:** input types: `openapi`, `jsonschema`
- **Keep the old output:** `--no-use-specialized-enum`
- **Pull requests and issues:** [#2512](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/2512)
- **Source:** the release notes

```diff
-class Status(Enum):
+class Status(StrEnum):
```

### Models of `anyOf` members lose the `Item` suffix (0.2.0) { #union-item-suffix-removed }

Models of `anyOf` and `oneOf` members no longer end in `Item`.

- **Keep the old output:** No option restores the old names; `--model-name-map` can pin individual names.
- **Pull requests and issues:** [#1682](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/1682)
- **Source:** the release notes

### --validation now emits DeprecationWarning (0.2.0) { #deprecation-cli-validation }

--validation is deprecated.

- **Affects:** only with: `--validation`
- **What to change:** Use --field-constraints.
- **Source:** the registry of deprecations, experimental features and dated presets

### New dated presets `standard-py3XX-20260101` and `practical-py3XX-20260101` (0.2.0) { #preset-20260101 }

The first dated presets; the [presets page](https://datamodel-code-generator.koxudaxi.dev/presets/) lists their options.

- **Source:** the registry of deprecations, experimental features and dated presets
--- migration/index.md ---
# Upgrading to 0.4.0

<!-- Generated by scripts/build_migration_docs.py. Do not edit manually. -->

Pick the release you use now. Its page lists, for that release only, the options that keep your current output in 0.4.0, the changes you must make and the changes no option keeps. Coding agents can read the same steps as Markdown: `https://datamodel-code-generator.koxudaxi.dev/migration/from/<release>.md`, for example `https://datamodel-code-generator.koxudaxi.dev/migration/from/0.1.0.md`.

Every change is listed for upgrades from 0.2.0 and later. The lists of older releases, marked incomplete, lack changes not written down yet: also read the breaking changes of the releases after yours through 0.2.0 in the [changelog](https://github.com/datamodel-code-generator/datamodel-code-generator/blob/main/CHANGELOG.md).

<div class="dcg-migration" data-migration-select hidden>
<label for="dcg-migration-from">I use datamodel-code-generator</label>
<select id="dcg-migration-from">
<option value="">choose a release</option>
<option value="from-0.3.0/">0.3.0</option>
<option value="from-0.2.0/">0.2.0</option>
<option value="from-0.1.0/">0.1.0 (incomplete list)</option>
</select>
</div>

| Your release | Required | Kept by an option | Not kept | New warnings | Page |
|---|---|---|---|---|---|
| 0.3.0 | 2 | 0 | 0 | 0 | [from-0.3.0](from-0.3.0.md) |
| 0.2.0 | 3 | 3 | 0 | 2 | [from-0.2.0](from-0.2.0.md) |
| 0.1.0 (incomplete list) | 3 | 4 | 1 | 3 | [from-0.1.0](from-0.1.0.md) |

Releases before 0.1.0: start from the 0.1.0 page and read the older entries of the [changelog](https://github.com/datamodel-code-generator/datamodel-code-generator/blob/main/CHANGELOG.md).

## How to upgrade without surprises

1. Add the options of your page; they keep the output where the new release can.
2. Regenerate and compare: `datamodel-codegen ... --check` fails on any difference.
3. Make the required changes and review the changes no option keeps.
4. Later, drop one keep option at a time, or move to the newest dated preset.

[All changes by release](changes.md) lists every entry with its details, newest first.
--- output-changes/0.3.0.md ---
# Output changes in 0.3.0

--- from-0.1.0.md ---
# Upgrading from 0.1.0 to 0.4.0

<!-- Generated by scripts/build_migration_docs.py. Do not edit manually. -->

For datamodel-code-generator 0.1.0. On the way to 0.4.0: 3 required changes, 4 output changes an option keeps, 1 changes no option keeps, 3 new warnings, 6 changes that need nothing. Each item names the release that made it. [All changes](changes.md) · [Machine-readable list](https://datamodel-code-generator.koxudaxi.dev/data/migration.json)

**Incomplete list:** the changes of the releases after yours through 0.2.0 are not all listed yet. Read the breaking changes of those releases in the [changelog](https://github.com/datamodel-code-generator/datamodel-code-generator/blob/main/CHANGELOG.md) too; every change after 0.2.0 is listed.

## Keep your current output

Add these options to keep the output of your release where 0.4.0 can (every option exists in 0.4.0):

```bash
datamodel-codegen ... --no-use-specialized-enum --output-datetime-class datetime
```

or in `pyproject.toml`:

```toml
[tool.datamodel-codegen]
use-specialized-enum = false
output-datetime-class = "datetime"
```

Only if you pass `--use-annotated`, also add `--field-constraints`.

Outside the command line:

- `generate_dynamic_models()` no longer formats the code it builds: Pass `formatters=[Formatter.BLACK, Formatter.ISORT]` in the config.

## Required changes

### datamodel-code-generator no longer runs on Python 3.8 (0.3.0) { #python-38-runtime-dropped }

Install and run the generator on Python 3.9 or newer.

- **What to change:** Use Python 3.9 or newer.
- **Pull requests and issues:** [#3003](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3003)
- **Source:** the release notes

### An empty `enum` is refused (0.4.0) { #refuse-empty-enum }

A schema with `enum: []` fails with an error instead of generating an empty enum.

- **What to change:** Drop the empty `enum` keyword.
- **Pull requests and issues:** [#4002](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/4002)
- **Source:** the release notes

### `--validation` is removed (0.4.0) { #removal-cli-validation }

--validation is deprecated.

- **Affects:** only with: `--validation`
- **What to change:** Use --field-constraints.
- **Source:** the registry of deprecations, experimental features and dated presets

## Output changes an option keeps

### String enums become `StrEnum` (0.2.0) { #specialized-enum-default }

Enums of strings subclass `StrEnum` instead of `Enum`.

- **Affects:** input types: `openapi`, `jsonschema`
- **Keep the old output:** `--no-use-specialized-enum`
- **Pull requests and issues:** [#2512](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/2512)
- **Source:** the release notes

```diff
-class Status(Enum):
+class Status(StrEnum):
```

### Constraints move into `Annotated` (0.3.0) { #annotated-constraints }

With `--use-annotated`, constraints are written in `Annotated`.

- **Affects:** only with: `--use-annotated`
- **Keep the old output:** `--field-constraints`
- **Pull requests and issues:** [#3001](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3001)
- **Source:** the release notes

### `format: date-time` becomes `AwareDatetime` (0.3.0) { #aware-datetime }

A timestamp without a UTC offset is rejected.

- **Affects:** output model types: `pydantic_v2.BaseModel`
- **Keep the old output:** `--output-datetime-class datetime`
- **Pull requests and issues:** [#1735](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/1735)
- **Source:** the release notes

### `generate_dynamic_models()` no longer formats the code it builds (0.3.0) { #dynamic-models-unformatted }

It skips Black and isort unless formatters are selected.

- **Affects:** Python API: `generate_dynamic_models`
- **Keep the old output:** Pass `formatters=[Formatter.BLACK, Formatter.ISORT]` in the config.
- **Pull requests and issues:** [#6750](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/6750)
- **Source:** the release notes

## Changes no option keeps

### Models of `anyOf` members lose the `Item` suffix (0.2.0) { #union-item-suffix-removed }

Models of `anyOf` and `oneOf` members no longer end in `Item`.

- **Keep the old output:** No option restores the old names; `--model-name-map` can pin individual names.
- **Pull requests and issues:** [#1682](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/1682)
- **Source:** the release notes

## New warnings (act before the planned removal)

- --validation now emits DeprecationWarning (0.2.0): Use --field-constraints. Only if you use `--validation`. [details](changes.md#deprecation-cli-validation)
- PythonVersion.has_type_alias now emits DeprecationWarning (0.3.0) Only if you use `PythonVersion.has_type_alias`. [details](changes.md#deprecation-python-api-python-version-has-type-alias)

## New warnings

- `--type-overrides` keys that match nothing emit a `UserWarning` (0.3.0): Fix or drop the keys the warning names. Only if you use `--type-overrides`. [details](changes.md#unmatched-override-keys)

## Also changed, no action needed

- New dated presets `standard-py3XX-20260101` and `practical-py3XX-20260101` (0.2.0) [details](changes.md#preset-20260101)
- --input-file-type avro is experimental (0.3.0) [details](changes.md#experimental-input-format-avro)
- New value `b` of `--output-model-type` (0.3.0) [details](changes.md#option-output-model-type-b)
- New option `--released-flag` (0.3.0) [details](changes.md#option-released-flag)
- New dated presets `standard-py3XX-20260201` and `practical-py3XX-20260201` (0.3.0) [details](changes.md#preset-20260201)
- The warning of an unknown format names the field (0.3.0) [details](changes.md#quiet-warning-text)
--- from-0.2.0.md ---
# Upgrading from 0.2.0 to 0.4.0

<!-- Generated by scripts/build_migration_docs.py. Do not edit manually. -->

For datamodel-code-generator 0.2.0. On the way to 0.4.0: 3 required changes, 3 output changes an option keeps, 0 changes no option keeps, 2 new warnings, 5 changes that need nothing. Each item names the release that made it. [All changes](changes.md) · [Machine-readable list](https://datamodel-code-generator.koxudaxi.dev/data/migration.json)

## Keep your current output

Add these options to keep the output of your release where 0.4.0 can (every option exists in 0.4.0):

```bash
datamodel-codegen ... --output-datetime-class datetime
```

or in `pyproject.toml`:

```toml
[tool.datamodel-codegen]
output-datetime-class = "datetime"
```

Only if you pass `--use-annotated`, also add `--field-constraints`.

Outside the command line:

- `generate_dynamic_models()` no longer formats the code it builds: Pass `formatters=[Formatter.BLACK, Formatter.ISORT]` in the config.

## Required changes

### datamodel-code-generator no longer runs on Python 3.8 (0.3.0) { #python-38-runtime-dropped }

Install and run the generator on Python 3.9 or newer.

- **What to change:** Use Python 3.9 or newer.
- **Pull requests and issues:** [#3003](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3003)
- **Source:** the release notes

### An empty `enum` is refused (0.4.0) { #refuse-empty-enum }

A schema with `enum: []` fails with an error instead of generating an empty enum.

- **What to change:** Drop the empty `enum` keyword.
- **Pull requests and issues:** [#4002](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/4002)
- **Source:** the release notes

### `--validation` is removed (0.4.0) { #removal-cli-validation }

--validation is deprecated.

- **Affects:** only with: `--validation`
- **What to change:** Use --field-constraints.
- **Source:** the registry of deprecations, experimental features and dated presets

## Output changes an option keeps

### Constraints move into `Annotated` (0.3.0) { #annotated-constraints }

With `--use-annotated`, constraints are written in `Annotated`.

- **Affects:** only with: `--use-annotated`
- **Keep the old output:** `--field-constraints`
- **Pull requests and issues:** [#3001](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3001)
- **Source:** the release notes

### `format: date-time` becomes `AwareDatetime` (0.3.0) { #aware-datetime }

A timestamp without a UTC offset is rejected.

- **Affects:** output model types: `pydantic_v2.BaseModel`
- **Keep the old output:** `--output-datetime-class datetime`
- **Pull requests and issues:** [#1735](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/1735)
- **Source:** the release notes

### `generate_dynamic_models()` no longer formats the code it builds (0.3.0) { #dynamic-models-unformatted }

It skips Black and isort unless formatters are selected.

- **Affects:** Python API: `generate_dynamic_models`
- **Keep the old output:** Pass `formatters=[Formatter.BLACK, Formatter.ISORT]` in the config.
- **Pull requests and issues:** [#6750](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/6750)
- **Source:** the release notes

## New warnings (act before the planned removal)

- PythonVersion.has_type_alias now emits DeprecationWarning (0.3.0) Only if you use `PythonVersion.has_type_alias`. [details](changes.md#deprecation-python-api-python-version-has-type-alias)

## New warnings

- `--type-overrides` keys that match nothing emit a `UserWarning` (0.3.0): Fix or drop the keys the warning names. Only if you use `--type-overrides`. [details](changes.md#unmatched-override-keys)

## Also changed, no action needed

- --input-file-type avro is experimental (0.3.0) [details](changes.md#experimental-input-format-avro)
- New value `b` of `--output-model-type` (0.3.0) [details](changes.md#option-output-model-type-b)
- New option `--released-flag` (0.3.0) [details](changes.md#option-released-flag)
- New dated presets `standard-py3XX-20260201` and `practical-py3XX-20260201` (0.3.0) [details](changes.md#preset-20260201)
- The warning of an unknown format names the field (0.3.0) [details](changes.md#quiet-warning-text)
--- from-0.3.0.md ---
# Upgrading from 0.3.0 to 0.4.0

<!-- Generated by scripts/build_migration_docs.py. Do not edit manually. -->

For datamodel-code-generator 0.3.0. On the way to 0.4.0: 2 required changes, 0 output changes an option keeps, 0 changes no option keeps, 0 new warnings, 1 changes that need nothing. Each item names the release that made it. [All changes](changes.md) · [Machine-readable list](https://datamodel-code-generator.koxudaxi.dev/data/migration.json)

## Keep your current output

No option is needed to keep your output; check the changes below.

## Required changes

### An empty `enum` is refused (0.4.0) { #refuse-empty-enum }

A schema with `enum: []` fails with an error instead of generating an empty enum.

- **What to change:** Drop the empty `enum` keyword.
- **Pull requests and issues:** [#4002](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/4002)
- **Source:** the release notes

### `--validation` is removed (0.4.0) { #removal-cli-validation }

--validation is deprecated.

- **Affects:** only with: `--validation`
- **What to change:** Use --field-constraints.
- **Source:** the registry of deprecations, experimental features and dated presets

## Also changed, no action needed

- Class docstrings are no longer wrapped (0.4.0) [details](changes.md#docstrings-unwrapped)

--- migration/from/0.1.0.md ---
# Upgrading from 0.1.0 to 0.4.0

<!-- Generated by scripts/build_migration_docs.py. Do not edit manually. -->

For datamodel-code-generator 0.1.0; the [upgrade guide](https://datamodel-code-generator.koxudaxi.dev/migration/) has the other releases. On the way to 0.4.0: 3 required changes, 4 output changes an option keeps, 1 changes no option keeps, 3 new warnings, 6 changes that need nothing. Each item names the release that made it. [All changes](https://datamodel-code-generator.koxudaxi.dev/migration/changes/) · [Machine-readable list](https://datamodel-code-generator.koxudaxi.dev/data/migration.json)

**Incomplete list:** the changes of the releases after yours through 0.2.0 are not all listed yet. Read the breaking changes of those releases in the [changelog](https://github.com/datamodel-code-generator/datamodel-code-generator/blob/main/CHANGELOG.md) too; every change after 0.2.0 is listed.

## Keep your current output

Add these options to keep the output of your release where 0.4.0 can (every option exists in 0.4.0):

```bash
datamodel-codegen ... --no-use-specialized-enum --output-datetime-class datetime
```

or in `pyproject.toml`:

```toml
[tool.datamodel-codegen]
use-specialized-enum = false
output-datetime-class = "datetime"
```

Only if you pass `--use-annotated`, also add `--field-constraints`.

Outside the command line:

- `generate_dynamic_models()` no longer formats the code it builds: Pass `formatters=[Formatter.BLACK, Formatter.ISORT]` in the config.

## Required changes

### datamodel-code-generator no longer runs on Python 3.8 (0.3.0) { #python-38-runtime-dropped }

Install and run the generator on Python 3.9 or newer.

- **What to change:** Use Python 3.9 or newer.
- **Pull requests and issues:** [#3003](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3003)
- **Source:** the release notes

### An empty `enum` is refused (0.4.0) { #refuse-empty-enum }

A schema with `enum: []` fails with an error instead of generating an empty enum.

- **What to change:** Drop the empty `enum` keyword.
- **Pull requests and issues:** [#4002](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/4002)
- **Source:** the release notes

### `--validation` is removed (0.4.0) { #removal-cli-validation }

--validation is deprecated.

- **Affects:** only with: `--validation`
- **What to change:** Use --field-constraints.
- **Source:** the registry of deprecations, experimental features and dated presets

## Output changes an option keeps

### String enums become `StrEnum` (0.2.0) { #specialized-enum-default }

Enums of strings subclass `StrEnum` instead of `Enum`.

- **Affects:** input types: `openapi`, `jsonschema`
- **Keep the old output:** `--no-use-specialized-enum`
- **Pull requests and issues:** [#2512](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/2512)
- **Source:** the release notes

```diff
-class Status(Enum):
+class Status(StrEnum):
```

### Constraints move into `Annotated` (0.3.0) { #annotated-constraints }

With `--use-annotated`, constraints are written in `Annotated`.

- **Affects:** only with: `--use-annotated`
- **Keep the old output:** `--field-constraints`
- **Pull requests and issues:** [#3001](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3001)
- **Source:** the release notes

### `format: date-time` becomes `AwareDatetime` (0.3.0) { #aware-datetime }

A timestamp without a UTC offset is rejected.

- **Affects:** output model types: `pydantic_v2.BaseModel`
- **Keep the old output:** `--output-datetime-class datetime`
- **Pull requests and issues:** [#1735](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/1735)
- **Source:** the release notes

### `generate_dynamic_models()` no longer formats the code it builds (0.3.0) { #dynamic-models-unformatted }

It skips Black and isort unless formatters are selected.

- **Affects:** Python API: `generate_dynamic_models`
- **Keep the old output:** Pass `formatters=[Formatter.BLACK, Formatter.ISORT]` in the config.
- **Pull requests and issues:** [#6750](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/6750)
- **Source:** the release notes

## Changes no option keeps

### Models of `anyOf` members lose the `Item` suffix (0.2.0) { #union-item-suffix-removed }

Models of `anyOf` and `oneOf` members no longer end in `Item`.

- **Keep the old output:** No option restores the old names; `--model-name-map` can pin individual names.
- **Pull requests and issues:** [#1682](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/1682)
- **Source:** the release notes

## New warnings (act before the planned removal)

- --validation now emits DeprecationWarning (0.2.0): Use --field-constraints. Only if you use `--validation`. [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#deprecation-cli-validation)
- PythonVersion.has_type_alias now emits DeprecationWarning (0.3.0) Only if you use `PythonVersion.has_type_alias`. [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#deprecation-python-api-python-version-has-type-alias)

## New warnings

- `--type-overrides` keys that match nothing emit a `UserWarning` (0.3.0): Fix or drop the keys the warning names. Only if you use `--type-overrides`. [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#unmatched-override-keys)

## Also changed, no action needed

- New dated presets `standard-py3XX-20260101` and `practical-py3XX-20260101` (0.2.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#preset-20260101)
- --input-file-type avro is experimental (0.3.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#experimental-input-format-avro)
- New value `b` of `--output-model-type` (0.3.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#option-output-model-type-b)
- New option `--released-flag` (0.3.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#option-released-flag)
- New dated presets `standard-py3XX-20260201` and `practical-py3XX-20260201` (0.3.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#preset-20260201)
- The warning of an unknown format names the field (0.3.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#quiet-warning-text)
--- migration/from/0.2.0.md ---
# Upgrading from 0.2.0 to 0.4.0

<!-- Generated by scripts/build_migration_docs.py. Do not edit manually. -->

For datamodel-code-generator 0.2.0; the [upgrade guide](https://datamodel-code-generator.koxudaxi.dev/migration/) has the other releases. On the way to 0.4.0: 3 required changes, 3 output changes an option keeps, 0 changes no option keeps, 2 new warnings, 5 changes that need nothing. Each item names the release that made it. [All changes](https://datamodel-code-generator.koxudaxi.dev/migration/changes/) · [Machine-readable list](https://datamodel-code-generator.koxudaxi.dev/data/migration.json)

## Keep your current output

Add these options to keep the output of your release where 0.4.0 can (every option exists in 0.4.0):

```bash
datamodel-codegen ... --output-datetime-class datetime
```

or in `pyproject.toml`:

```toml
[tool.datamodel-codegen]
output-datetime-class = "datetime"
```

Only if you pass `--use-annotated`, also add `--field-constraints`.

Outside the command line:

- `generate_dynamic_models()` no longer formats the code it builds: Pass `formatters=[Formatter.BLACK, Formatter.ISORT]` in the config.

## Required changes

### datamodel-code-generator no longer runs on Python 3.8 (0.3.0) { #python-38-runtime-dropped }

Install and run the generator on Python 3.9 or newer.

- **What to change:** Use Python 3.9 or newer.
- **Pull requests and issues:** [#3003](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3003)
- **Source:** the release notes

### An empty `enum` is refused (0.4.0) { #refuse-empty-enum }

A schema with `enum: []` fails with an error instead of generating an empty enum.

- **What to change:** Drop the empty `enum` keyword.
- **Pull requests and issues:** [#4002](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/4002)
- **Source:** the release notes

### `--validation` is removed (0.4.0) { #removal-cli-validation }

--validation is deprecated.

- **Affects:** only with: `--validation`
- **What to change:** Use --field-constraints.
- **Source:** the registry of deprecations, experimental features and dated presets

## Output changes an option keeps

### Constraints move into `Annotated` (0.3.0) { #annotated-constraints }

With `--use-annotated`, constraints are written in `Annotated`.

- **Affects:** only with: `--use-annotated`
- **Keep the old output:** `--field-constraints`
- **Pull requests and issues:** [#3001](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/3001)
- **Source:** the release notes

### `format: date-time` becomes `AwareDatetime` (0.3.0) { #aware-datetime }

A timestamp without a UTC offset is rejected.

- **Affects:** output model types: `pydantic_v2.BaseModel`
- **Keep the old output:** `--output-datetime-class datetime`
- **Pull requests and issues:** [#1735](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/1735)
- **Source:** the release notes

### `generate_dynamic_models()` no longer formats the code it builds (0.3.0) { #dynamic-models-unformatted }

It skips Black and isort unless formatters are selected.

- **Affects:** Python API: `generate_dynamic_models`
- **Keep the old output:** Pass `formatters=[Formatter.BLACK, Formatter.ISORT]` in the config.
- **Pull requests and issues:** [#6750](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/6750)
- **Source:** the release notes

## New warnings (act before the planned removal)

- PythonVersion.has_type_alias now emits DeprecationWarning (0.3.0) Only if you use `PythonVersion.has_type_alias`. [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#deprecation-python-api-python-version-has-type-alias)

## New warnings

- `--type-overrides` keys that match nothing emit a `UserWarning` (0.3.0): Fix or drop the keys the warning names. Only if you use `--type-overrides`. [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#unmatched-override-keys)

## Also changed, no action needed

- --input-file-type avro is experimental (0.3.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#experimental-input-format-avro)
- New value `b` of `--output-model-type` (0.3.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#option-output-model-type-b)
- New option `--released-flag` (0.3.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#option-released-flag)
- New dated presets `standard-py3XX-20260201` and `practical-py3XX-20260201` (0.3.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#preset-20260201)
- The warning of an unknown format names the field (0.3.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#quiet-warning-text)
--- migration/from/0.3.0.md ---
# Upgrading from 0.3.0 to 0.4.0

<!-- Generated by scripts/build_migration_docs.py. Do not edit manually. -->

For datamodel-code-generator 0.3.0; the [upgrade guide](https://datamodel-code-generator.koxudaxi.dev/migration/) has the other releases. On the way to 0.4.0: 2 required changes, 0 output changes an option keeps, 0 changes no option keeps, 0 new warnings, 1 changes that need nothing. Each item names the release that made it. [All changes](https://datamodel-code-generator.koxudaxi.dev/migration/changes/) · [Machine-readable list](https://datamodel-code-generator.koxudaxi.dev/data/migration.json)

## Keep your current output

No option is needed to keep your output; check the changes below.

## Required changes

### An empty `enum` is refused (0.4.0) { #refuse-empty-enum }

A schema with `enum: []` fails with an error instead of generating an empty enum.

- **What to change:** Drop the empty `enum` keyword.
- **Pull requests and issues:** [#4002](https://github.com/datamodel-code-generator/datamodel-code-generator/issues/4002)
- **Source:** the release notes

### `--validation` is removed (0.4.0) { #removal-cli-validation }

--validation is deprecated.

- **Affects:** only with: `--validation`
- **What to change:** Use --field-constraints.
- **Source:** the registry of deprecations, experimental features and dated presets

## Also changed, no action needed

- Class docstrings are no longer wrapped (0.4.0) [details](https://datamodel-code-generator.koxudaxi.dev/migration/changes/#docstrings-unwrapped)
--- migration/from/0.4.0.md ---
# datamodel-code-generator 0.4.0

0.4.0 is the latest release: nothing to change.
