Datamodel Code Generator Versions Save

Pydantic model and dataclasses.dataclass generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources.

0.23.0

6 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.22.1...0.23.0

0.22.1

7 months ago

What's Changed

Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.22.0...0.22.1

0.22.0

7 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.5...0.22.0

0.21.5

8 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.4...0.21.5

0.21.4

9 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.3...0.21.4

0.21.3

9 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.2...0.21.3

0.21.2

9 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.1...0.21.2

0.21.1

10 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.0...0.21.1

0.21.0

10 months ago

What's Changed

New Contributors

What is the difference between pydantic v1 and v2 output model?

Summary

datamodel-code-generator supports Pydantic v1 and v2 as output model type.

Pydantic v2 is a major release with many breaking changes. See the migration guide for more information: https://docs.pydantic.dev/2.0/migration/

What's changes in v2 output?

__root__ field (a.k.a Custom Root Types)

__root__ field (a.k.a Custom Root Types) is removed in pydantic v2. The model is changed to RootModel

pydantic.Field

https://docs.pydantic.dev/2.0/migration/#changes-to-pydanticfield

  • const -> removed
  • min_items (use min_length instead)
  • max_items (use max_length instead)
  • unique_items -> removed and the list type will be replaced by typing.Set. this feature is discussed in https://github.com/pydantic/pydantic-core/issues/296
  • allow_mutation (use frozen instead)
  • regex (use pattern instead)

Model Config

  • pydantic.Config -> pydantic.ConfigDict
  • allow_mutation —> frozen (inverse value for getting same behavior).
  • allow_population_by_field_name → populate_by_name

Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.20.0...0.21.0

0.20.0

11 months ago

What's Changed

Breaking Changes

Due to differences in file loading order between operating systems, we've added a sorting process when fetching file listings within directories in order to eliminate discrepancies in model and field names. As a result, model names that differ from those generated by existing earlier versions may be produced.

New Contributors

Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.19.0...0.20.0