|
8 | 8 | [](https://pypi.python.org/pypi/datamodel-code-generator) |
9 | 9 | [](https://codecov.io/gh/koxudaxi/datamodel-code-generator) |
10 | 10 |  |
11 | | -[](https://pydantic.dev) |
12 | 11 | [](https://pydantic.dev) |
13 | 12 |
|
14 | 13 | --- |
|
17 | 16 |
|
18 | 17 | - 📄 Converts **OpenAPI 3**, **JSON Schema**, **GraphQL**, and raw data (JSON/YAML/CSV) into Python models |
19 | 18 | - 🐍 Generates from **existing Python types** (Pydantic, dataclass, TypedDict) via `--input-model` |
20 | | -- 🎯 Generates **Pydantic v1/v2**, **dataclasses**, **TypedDict**, or **msgspec** output |
| 19 | +- 🎯 Generates **Pydantic v2**, **dataclasses**, **TypedDict**, or **msgspec** output |
21 | 20 | - 🔗 Handles complex schemas: `$ref`, `allOf`, `oneOf`, `anyOf`, enums, and nested types |
22 | 21 | - ✅ Produces type-safe, validated code ready for your IDE and type checker |
23 | 22 |
|
|
65 | 64 |
|
66 | 65 | !!! warning "Omitting --output-model-type is deprecated" |
67 | 66 | Starting from version 0.53.0, omitting `--output-model-type` is deprecated. |
68 | | - The implicit default `pydantic.BaseModel` (Pydantic v1) will be removed in a future version. |
69 | 67 |
|
70 | 68 | We recommend using `--output-model-type pydantic_v2.BaseModel` for new projects. |
71 | 69 |
|
@@ -113,9 +111,6 @@ datamodel-codegen --input pet.json --input-file-type jsonschema --output-model-t |
113 | 111 | # 🆕 Pydantic v2 (recommended for new projects) |
114 | 112 | datamodel-codegen --output-model-type pydantic_v2.BaseModel ... |
115 | 113 |
|
116 | | -# 🔄 Pydantic v1 (default, for compatibility) |
117 | | -datamodel-codegen --output-model-type pydantic.BaseModel ... |
118 | | - |
119 | 114 | # 🏗️ Python dataclasses |
120 | 115 | datamodel-codegen --output-model-type dataclasses.dataclass ... |
121 | 116 |
|
|
0 commit comments