Skip to content

Bump datamodel-code-generator from 0.37.0 to 0.42.1#148

Merged
github-actions[bot] merged 1 commit intomainfrom
dependabot/pip/datamodel-code-generator-0.42.1
Dec 8, 2025
Merged

Bump datamodel-code-generator from 0.37.0 to 0.42.1#148
github-actions[bot] merged 1 commit intomainfrom
dependabot/pip/datamodel-code-generator-0.42.1

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 8, 2025

Bumps datamodel-code-generator from 0.37.0 to 0.42.1.

Release notes

Sourced from datamodel-code-generator's releases.

0.42.1

What's Changed

New Contributors

Full Changelog: koxudaxi/datamodel-code-generator@0.42.0...0.42.1

0.42.0

What's Changed

Breaking Changes

Custom Template Update Required

If you use custom Jinja2 templates, you may need to update them to handle default_factory correctly with --use-annotated.

A new property field.has_default_factory_in_field has been added. Templates should check this property to avoid generating duplicate default assignments when Field(default_factory=...) is used.

Example change in templates:

{# Before #}
{%- if not (field.required or ...) %} = {{ field.represented_default }}{% endif %}
{# After #}
{%- if not field.has_default_factory_in_field and not (field.required or ...) %} = {{ field.represented_default }}{% endif %}

Affected built-in templates:

  • pydantic/BaseModel.jinja2
  • pydantic/BaseModel_root.jinja2
  • pydantic_v2/BaseModel.jinja2
  • pydantic_v2/RootModel.jinja2

Full Changelog: koxudaxi/datamodel-code-generator@0.41.0...0.42.0

... (truncated)

Commits
  • 61e2ca7 Use SerializeAsAny for pydantic v2 models with subclasses (#2612)
  • 1d3569f Fix --check mode ignoring pyproject.toml formatter settings (#2626)
  • de949b0 Fix ClassVar generation for msgspec Struct discriminator without use_annotate...
  • 0e61504 Preserve extras in oneOf/anyOf structures during initialization of JsonSchema...
  • aa714fc Fix msgspec discriminated union ClassVar generation and nullable type handlin...
  • ed2de6f Add warning when components/schemas is empty but paths exist (#2622)
  • 27d5f07 Refactor reference path handling and update circular import resolution to inc...
  • 70bf516 Add named profile support and --ignore-pyproject option for pyproject.toml co...
  • c7f65e8 Use default_factory for $ref with default values when using --use-annotated (...
  • ff5de87 Strict types now enforce field constraints (#2617)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator) from 0.37.0 to 0.42.1.
- [Release notes](https://github.com/koxudaxi/datamodel-code-generator/releases)
- [Commits](koxudaxi/datamodel-code-generator@0.37.0...0.42.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Dec 8, 2025
@github-actions github-actions bot enabled auto-merge (squash) December 8, 2025 20:12
@github-actions github-actions bot merged commit 9ed91a7 into main Dec 8, 2025
19 checks passed
@github-actions github-actions bot deleted the dependabot/pip/datamodel-code-generator-0.42.1 branch December 8, 2025 20:13
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.

0 participants