Skip to content

chore(deps-dev): bump datamodel-code-generator from 0.56.1 to 0.57.0#37

Merged
negillett merged 2 commits into
mainfrom
dependabot/pip/datamodel-code-generator-0.57.0
May 10, 2026
Merged

chore(deps-dev): bump datamodel-code-generator from 0.56.1 to 0.57.0#37
negillett merged 2 commits into
mainfrom
dependabot/pip/datamodel-code-generator-0.57.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github May 10, 2026

Copy link
Copy Markdown
Contributor

Bumps datamodel-code-generator from 0.56.1 to 0.57.0.

Release notes

Sourced from datamodel-code-generator's releases.

0.57.0

Breaking Changes

Code Generation Changes

  • --use-default no longer makes required fields nullable - Previously, --use-default turned required fields into optional nullable fields (e.g., status: str | None = 'active'). Now required fields keep their original non-nullable type and just get the default value rendered (e.g., status: str = 'active'). Users whose downstream code depends on these fields being Optional/nullable will need to update. (#3054)
  • Required model-ref fields no longer render defaults without --use-default - Previously, required fields referencing models (e.g., shipping_address: Address) inconsistently rendered defaults with validate_default=True while scalar required fields did not. Now all required fields consistently omit defaults unless --use-default is passed. Users who relied on the previous behavior where model-ref required fields had defaults rendered will see those defaults removed. (#3054)

Custom Template Update Required

  • Built-in Jinja2 templates now use field.use_default_with_required - The built-in templates for BaseModel, dataclass, pydantic_v2/dataclass, and msgspec were updated to check field.use_default_with_required alongside field.required when deciding whether to render defaults. Custom templates that replicate the old default-rendering logic (e.g., {%- if not field.required %}) will still work but won't support the new --use-default behavior for required fields. To get the updated behavior, custom templates should change conditions like not field.required to (not field.required or field.use_default_with_required). (#3054)

What's Changed

... (truncated)

Changelog

Sourced from datamodel-code-generator's changelog.

0.57.0 - 2026-05-07

Breaking Changes

Code Generation Changes

  • --use-default no longer makes required fields nullable - Previously, --use-default turned required fields into optional nullable fields (e.g., status: str | None = 'active'). Now required fields keep their original non-nullable type and just get the default value rendered (e.g., status: str = 'active'). Users whose downstream code depends on these fields being Optional/nullable will need to update. (#3054)
  • Required model-ref fields no longer render defaults without --use-default - Previously, required fields referencing models (e.g., shipping_address: Address) inconsistently rendered defaults with validate_default=True while scalar required fields did not. Now all required fields consistently omit defaults unless --use-default is passed. Users who relied on the previous behavior where model-ref required fields had defaults rendered will see those defaults removed. (#3054)

Custom Template Update Required

  • Built-in Jinja2 templates now use field.use_default_with_required - The built-in templates for BaseModel, dataclass, pydantic_v2/dataclass, and msgspec were updated to check field.use_default_with_required alongside field.required when deciding whether to render defaults. Custom templates that replicate the old default-rendering logic (e.g., {%- if not field.required %}) will still work but won't support the new --use-default behavior for required fields. To get the updated behavior, custom templates should change conditions like not field.required to (not field.required or field.use_default_with_required). (#3054)

What's Changed

New Contributors

Full Changelog: koxudaxi/datamodel-code-generator@0.56.1...0.57.0


Commits

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file python Pull requests that update python code labels May 10, 2026
@dependabot dependabot Bot requested a review from negillett as a code owner May 10, 2026 11:03
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file python Pull requests that update python code labels May 10, 2026
@dependabot dependabot Bot force-pushed the dependabot/pip/datamodel-code-generator-0.57.0 branch 2 times, most recently from 0098d06 to 8196368 Compare May 10, 2026 20:24
@negillett negillett force-pushed the dependabot/pip/datamodel-code-generator-0.57.0 branch from 8196368 to a3eec82 Compare May 10, 2026 20:54
Bumps [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator) from 0.56.1 to 0.57.0.
- [Release notes](https://github.com/koxudaxi/datamodel-code-generator/releases)
- [Changelog](https://github.com/koxudaxi/datamodel-code-generator/blob/main/CHANGELOG.md)
- [Commits](koxudaxi/datamodel-code-generator@0.56.1...0.57.0)

---
updated-dependencies:
- dependency-name: datamodel-code-generator
  dependency-version: 0.57.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@negillett negillett force-pushed the dependabot/pip/datamodel-code-generator-0.57.0 branch from a3eec82 to 7398dff Compare May 10, 2026 20:56
verify-generated-types embeds the installed generator version; commit the
regenerated fingerprint so tox static matches the bumped dev dependency.

Co-authored-by: Cursor <cursoragent@cursor.com>
@negillett negillett merged commit 7e2c4fd into main May 10, 2026
12 checks passed
@dependabot dependabot Bot deleted the dependabot/pip/datamodel-code-generator-0.57.0 branch May 10, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant