Skip to content

Build: Bump datamodel-code-generator from 0.54.1 to 0.55.0#15635

Closed
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/pip/datamodel-code-generator-0.55.0
Closed

Build: Bump datamodel-code-generator from 0.54.1 to 0.55.0#15635
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/pip/datamodel-code-generator-0.55.0

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 15, 2026

Bumps datamodel-code-generator from 0.54.1 to 0.55.0.

Release notes

Sourced from datamodel-code-generator's releases.

0.55.0

Breaking Changes

Dependency Changes

  • Pydantic v1 runtime support removed - Pydantic v2 is now required as a runtime dependency. Users running datamodel-code-generator with Pydantic v1 installed must upgrade to Pydantic v2. The previously deprecated v1 compatibility layer has been completely removed. (#3025)

Default Behavior Changes

  • Default output model switched from Pydantic v1 to v2 - Running datamodel-codegen without specifying --output-model-type now generates Pydantic v2 models (pydantic_v2.BaseModel) instead of Pydantic v1 models (pydantic.BaseModel). Users who depend on the previous default behavior must now explicitly specify --output-model-type pydantic.BaseModel to continue generating Pydantic v1 compatible code. (#3029)

Code Generation Changes

  • Generated model syntax changed for default output - The default generated code now uses Pydantic v2 syntax including RootModel instead of __root__ fields, native union syntax (str | None) instead of Optional[str], and Pydantic v2 validator/serializer decorators. Existing code that consumes generated models may need updates to work with the new Pydantic v2 output format. (#3029)
  • Pydantic v1 output support removed - The pydantic.BaseModel output model type has been completely removed. Generated code now only supports Pydantic v2 patterns including RootModel instead of __root__, model_rebuild() instead of update_forward_refs(), and model_config instead of class Config. Users generating Pydantic v1 models must migrate to v2 output. (#3031)

Custom Template Update Required

  • Pydantic v1 templates removed - The following Jinja2 templates have been deleted and users with custom templates extending them must migrate to v2 equivalents:
    • pydantic/BaseModel.jinja2 → use pydantic_v2/BaseModel.jinja2
    • pydantic/BaseModel_root.jinja2 → use pydantic_v2/RootModel.jinja2
    • pydantic/Config.jinja2 → removed (v2 uses model_config dict) (#3031)

API/CLI Changes

  • --output-model-type pydantic.BaseModel removed - The pydantic.BaseModel value for --output-model-type is no longer valid. Use pydantic_v2.BaseModel instead (now the default). (#3031)
  • Pydantic v1 compatibility utilities removed from Python API - The following functions were removed from datamodel_code_generator.util: model_dump(), model_validate(), get_fields_set(), model_copy(). Use Pydantic v2 methods directly (obj.model_dump(), cls.model_validate(), etc.). (#3031)
  • datamodel_code_generator.model.pydantic module removed - The entire Pydantic v1 model module including BaseModel, CustomRootType, DataModelField, DataTypeManager, and dump_resolve_reference_action has been removed. Use datamodel_code_generator.model.pydantic_v2 instead. (#3031)
  • Pydantic v2 now required at runtime - The minimum pydantic dependency changed from pydantic>=1.5 to pydantic>=2,<3. Users with pydantic v1 installed must upgrade to pydantic v2 before using datamodel-code-generator (#3027)
  • Removed internal pydantic compatibility utilities - The following functions/classes were removed from datamodel_code_generator.util: get_pydantic_version(), is_pydantic_v2(), model_validator(), field_validator(), and ConfigDict. Users who imported these internal utilities directly must update their code to use pydantic's native APIs (#3027)
  • Removed datamodel_code_generator.pydantic_patch module - The entire pydantic compatibility patching module was removed. Any code importing from this module will fail (#3027)
  • Removed packaging dependency - The packaging library is no longer a dependency. Code that relied on it being transitively available should add it explicitly (#3027)

What's Changed

... (truncated)

Changelog

Sourced from datamodel-code-generator's changelog.

0.55.0 - 2026-03-10

Breaking Changes

Dependency Changes

  • Pydantic v1 runtime support removed - Pydantic v2 is now required as a runtime dependency. Users running datamodel-code-generator with Pydantic v1 installed must upgrade to Pydantic v2. The previously deprecated v1 compatibility layer has been completely removed. (#3025)

Default Behavior Changes

  • Default output model switched from Pydantic v1 to v2 - Running datamodel-codegen without specifying --output-model-type now generates Pydantic v2 models (pydantic_v2.BaseModel) instead of Pydantic v1 models (pydantic.BaseModel). Users who depend on the previous default behavior must now explicitly specify --output-model-type pydantic.BaseModel to continue generating Pydantic v1 compatible code. (#3029)

Code Generation Changes

  • Generated model syntax changed for default output - The default generated code now uses Pydantic v2 syntax including RootModel instead of __root__ fields, native union syntax (str | None) instead of Optional[str], and Pydantic v2 validator/serializer decorators. Existing code that consumes generated models may need updates to work with the new Pydantic v2 output format. (#3029)
  • Pydantic v1 output support removed - The pydantic.BaseModel output model type has been completely removed. Generated code now only supports Pydantic v2 patterns including RootModel instead of __root__, model_rebuild() instead of update_forward_refs(), and model_config instead of class Config. Users generating Pydantic v1 models must migrate to v2 output. (#3031)

Custom Template Update Required

  • Pydantic v1 templates removed - The following Jinja2 templates have been deleted and users with custom templates extending them must migrate to v2 equivalents:
    • pydantic/BaseModel.jinja2 → use pydantic_v2/BaseModel.jinja2
    • pydantic/BaseModel_root.jinja2 → use pydantic_v2/RootModel.jinja2
    • pydantic/Config.jinja2 → removed (v2 uses model_config dict) (#3031)

API/CLI Changes

  • --output-model-type pydantic.BaseModel removed - The pydantic.BaseModel value for --output-model-type is no longer valid. Use pydantic_v2.BaseModel instead (now the default). (#3031)
  • Pydantic v1 compatibility utilities removed from Python API - The following functions were removed from datamodel_code_generator.util: model_dump(), model_validate(), get_fields_set(), model_copy(). Use Pydantic v2 methods directly (obj.model_dump(), cls.model_validate(), etc.). (#3031)
  • datamodel_code_generator.model.pydantic module removed - The entire Pydantic v1 model module including BaseModel, CustomRootType, DataModelField, DataTypeManager, and dump_resolve_reference_action has been removed. Use datamodel_code_generator.model.pydantic_v2 instead. (#3031)
  • Pydantic v2 now required at runtime - The minimum pydantic dependency changed from pydantic>=1.5 to pydantic>=2,<3. Users with pydantic v1 installed must upgrade to pydantic v2 before using datamodel-code-generator (#3027)
  • Removed internal pydantic compatibility utilities - The following functions/classes were removed from datamodel_code_generator.util: get_pydantic_version(), is_pydantic_v2(), model_validator(), field_validator(), and ConfigDict. Users who imported these internal utilities directly must update their code to use pydantic's native APIs (#3027)
  • Removed datamodel_code_generator.pydantic_patch module - The entire pydantic compatibility patching module was removed. Any code importing from this module will fail (#3027)
  • Removed packaging dependency - The packaging library is no longer a dependency. Code that relied on it being transitively available should add it explicitly (#3027)

What's Changed

... (truncated)

Commits

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 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.54.1 to 0.55.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.54.1...0.55.0)

---
updated-dependencies:
- dependency-name: datamodel-code-generator
  dependency-version: 0.55.0
  dependency-type: direct:production
  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 labels Mar 15, 2026
@manuzhang
Copy link
Member

Superseded by #15641

@manuzhang manuzhang closed this Mar 16, 2026
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Mar 16, 2026

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot bot deleted the dependabot/pip/datamodel-code-generator-0.55.0 branch March 16, 2026 04:36
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 OPENAPI python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant