Datamodel-code-generator

Latest version: v0.25.6

Safety actively analyzes 630360 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 31

0.21.0

What's Changed
* pyproject: correct poetry-core package name by ConnorBaker in https://github.com/koxudaxi/datamodel-code-generator/pull/1374
* Support pydantic v2 in runtime by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1392
* Add pydantic v2 as output model type by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1391
* Add --use-unique-items as set by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1400

New Contributors
* ConnorBaker made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1374

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](https://docs.pydantic.dev/1.10/usage/models/#custom-root-types))
`__root__` field (a.k.a [Custom Root Types](https://docs.pydantic.dev/1.10/usage/models/#custom-root-types)) is removed in pydantic v2.
The model is changed to [RootModel](https://docs.pydantic.dev/latest/usage/models/#rootmodel-and-custom-root-types)

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

What's Changed
* Update documentation by noddycode in https://github.com/koxudaxi/datamodel-code-generator/pull/1316
* Support TypedDict as output type by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1309
* Remove self attribute from jsonschema root attributes by rezen in https://github.com/koxudaxi/datamodel-code-generator/pull/1318
* Fix $ref With Path Items by zach-hamm in https://github.com/koxudaxi/datamodel-code-generator/pull/1323
* Remove keep-runtime-typing on ruff config by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1349
* Update `openapi-spec-validator` to `0.5.2` by Fokko in https://github.com/koxudaxi/datamodel-code-generator/pull/1343
* Added support for model wise base classes by senesh-deshan in https://github.com/koxudaxi/datamodel-code-generator/pull/1350
* Fix the custom file header by Fokko in https://github.com/koxudaxi/datamodel-code-generator/pull/1346

Breaking Changes
* Eliminate the naming differences of model names and field names by the OS by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1348

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
* noddycode made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1316
* rezen made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1318
* zach-hamm made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1323
* Fokko made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1343
* senesh-deshan made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1350

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

0.19.0

What's Changed
* Import Annotated from typing_extensions for Python <= 3.8 by airwoodix in https://github.com/koxudaxi/datamodel-code-generator/pull/1274
* Fix OpenAPI array response by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1261
* Fix unresolved nested ref in openapi by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1269
* Fix unsorted dataclass field by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1288
* Fix allOf-anyOf by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1291
* Fix null by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1299

New Contributors
* airwoodix made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1274

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

0.18.1

What's Changed
* default_factory field should be non-optional by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1254
* add --use-one-literal-as-default by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1256
* (🎁) Include `py.typed` to mark project as typed by KotlinIsland in https://github.com/koxudaxi/datamodel-code-generator/pull/1259
* Fix min/max on number fields truncated by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1266
* Add use_operation_id_as_name by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1267
* Add datetime to number and integer by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1268


**Full Changelog**: https://github.com/koxudaxi/datamodel-code-generator/compare/0.18.0...0.18.1

0.18.0

What's Changed
* Update __all__ to expose needed types by ShaneMurphy2 in https://github.com/koxudaxi/datamodel-code-generator/pull/1230
* Fix max min round issue by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1235
* Fix strict nullable for default factory by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1236
* Improve union types by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1241
* Support nested all_of by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1242
* (🎁) bump some dependencies by KotlinIsland in https://github.com/koxudaxi/datamodel-code-generator/pull/1245
* (🎁) log file type when `--input-file-type` is auto. by KotlinIsland in https://github.com/koxudaxi/datamodel-code-generator/pull/1248
* (🎁) remove typed-ast dependency by KotlinIsland in https://github.com/koxudaxi/datamodel-code-generator/pull/1246
* (🎁) reference config option to specify input type by KotlinIsland in https://github.com/koxudaxi/datamodel-code-generator/pull/1250
* (🎁) infer data vs schema when `--input-file-type` is auto by KotlinIsland in https://github.com/koxudaxi/datamodel-code-generator/pull/1249

New Contributors
* ShaneMurphy2 made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1230

**Full Changelog**: https://github.com/koxudaxi/datamodel-code-generator/compare/0.17.2...0.18.0

0.17.2

What's Changed
* Remove union operator error when target-python is 3.9 or early version by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1094
* Add ruff by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1095
* Fix only required anyof oneof by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1104
* Update mypy version to 1.0.0 by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1105
* fix mypy version to >=1.0.1,<1.1.0 by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1162
* Docs: typo by KPLauritzen in https://github.com/koxudaxi/datamodel-code-generator/pull/1153
* Fix typo: `docuemnt` -> `document` by kamyar in https://github.com/koxudaxi/datamodel-code-generator/pull/1179
* feat: add support for custom file header by Niraj-Kamdar in https://github.com/koxudaxi/datamodel-code-generator/pull/1164
* Exclude fields with default_factory from --use-default-kwarg by vogre in https://github.com/koxudaxi/datamodel-code-generator/pull/1186
* Bugfix: with deeply nested modules: empty paths did not get an __init__.py file created by dataway in https://github.com/koxudaxi/datamodel-code-generator/pull/1187
* Fix url $id by koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1214
* (🎁) deps: make typed-ast optional by KotlinIsland in https://github.com/koxudaxi/datamodel-code-generator/pull/1222

New Contributors
* KPLauritzen made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1153
* kamyar made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1179
* Niraj-Kamdar made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1164
* vogre made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1186
* dataway made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1187
* KotlinIsland made their first contribution in https://github.com/koxudaxi/datamodel-code-generator/pull/1222

**Full Changelog**: https://github.com/koxudaxi/datamodel-code-generator/compare/0.17.1...0.17.2

Page 4 of 31

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.