Pydantic model and dataclasses.dataclass generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources.
--remove-special-field-name-prefix
+ fields (e.g. enum members) starting with numbers by @lord-haffi in https://github.com/koxudaxi/datamodel-code-generator/pull/1654
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.22.1...0.23.0
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.22.0...0.22.1
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.5...0.22.0
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.4...0.21.5
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.3...0.21.4
dump_resolve_reference_action
to use model_rebuild
not update_forward_refs
by @lmmx in https://github.com/koxudaxi/datamodel-code-generator/pull/1468
base_class
validation similar to _validate_base_class
to bare generate
calls by @kylebebak in https://github.com/koxudaxi/datamodel-code-generator/pull/1453
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.2...0.21.3
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.1...0.21.2
None
by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1411
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.0...0.21.1
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/
__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
https://docs.pydantic.dev/2.0/migration/#changes-to-pydanticfield
typing.Set
. this feature is discussed in https://github.com/pydantic/pydantic-core/issues/296
pydantic.Config
-> pydantic.ConfigDict
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.20.0...0.21.0
openapi-spec-validator
to 0.5.2
by @Fokko in https://github.com/koxudaxi/datamodel-code-generator/pull/1343
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.
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.19.0...0.20.0