Skip to content

Commit 845e5a1

Browse files
committed
docs: remove pydantic v1 references
1 parent 29e75b7 commit 845e5a1

17 files changed

Lines changed: 115 additions & 439 deletions

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/datamodel-code-generator)](https://pypi.python.org/pypi/datamodel-code-generator)
99
[![codecov](https://codecov.io/gh/koxudaxi/datamodel-code-generator/graph/badge.svg?token=plzSSFb9Li)](https://codecov.io/gh/koxudaxi/datamodel-code-generator)
1010
![license](https://img.shields.io/github/license/koxudaxi/datamodel-code-generator.svg)
11-
[![Pydantic v1](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v1.json)](https://pydantic.dev)
1211
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
1312

1413
> 📣 💼 Maintainer update: Open to opportunities. 🔗 [koxudaxi.dev](https://koxudaxi.dev/?utm_source=github_readme&utm_medium=top&utm_campaign=open_to_work)
@@ -17,7 +16,7 @@
1716

1817
- 📄 Converts **OpenAPI 3**, **JSON Schema**, **GraphQL**, and raw data (JSON/YAML/CSV) into Python models
1918
- 🐍 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
2120
- 🔗 Handles complex schemas: `$ref`, `allOf`, `oneOf`, `anyOf`, enums, and nested types
2221
- ✅ Produces type-safe, validated code ready for your IDE and type checker
2322

@@ -161,7 +160,6 @@ class Pet(BaseModel):
161160

162161
## 📤 Supported Output
163162

164-
- [pydantic v1](https://docs.pydantic.dev/1.10/) BaseModel
165163
- [pydantic v2](https://docs.pydantic.dev/) BaseModel
166164
- [pydantic v2](https://docs.pydantic.dev/) dataclass
167165
- [dataclasses](https://docs.python.org/3/library/dataclasses.html)

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inputs:
1515
description: 'Input file type (openapi, jsonschema, json, yaml, csv, graphql)'
1616
required: true
1717
output-model-type:
18-
description: 'Output model type (pydantic_v2.BaseModel, pydantic.BaseModel, dataclasses.dataclass, typing.TypedDict, msgspec.Struct)'
18+
description: 'Output model type (pydantic_v2.BaseModel, dataclasses.dataclass, typing.TypedDict, msgspec.Struct)'
1919
required: true
2020
check:
2121
description: 'Validate that existing output is up to date (no generation)'

docs/ci-cd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ By default, the action runs in **check mode** (`--check`), which validates that
3333
| `input` | Yes | - | Input schema file or directory |
3434
| `output` | Yes | - | Output file or directory |
3535
| `input-file-type` | Yes | - | Input file type (`openapi`, `jsonschema`, `json`, `yaml`, `csv`, `graphql`) |
36-
| `output-model-type` | Yes | - | Output model type (`pydantic_v2.BaseModel`, `pydantic.BaseModel`, `dataclasses.dataclass`, `typing.TypedDict`, `msgspec.Struct`) |
36+
| `output-model-type` | Yes | - | Output model type (`pydantic_v2.BaseModel`, `dataclasses.dataclass`, `typing.TypedDict`, `msgspec.Struct`) |
3737
| `check` | No | `true` | Validate that existing output is up to date (no generation) |
3838
| `working-directory` | No | `.` | Working directory (where `pyproject.toml` is located) |
3939
| `profile` | No | - | Named profile from `pyproject.toml` |

docs/cli-reference/manual/profile.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ file. Each profile can override the default settings with its own set of options
2828
strict-nullable = true
2929

3030
[tool.datamodel-codegen.profiles.legacy]
31-
# Legacy profile for Pydantic v1
32-
output-model-type = "pydantic.BaseModel"
31+
# Legacy profile
32+
output-model-type = "pydantic_v2.BaseModel"
3333
```
3434

3535
Use profiles:

docs/cli-reference/utility-options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ file. Each profile can override the default settings with its own set of options
162162
strict-nullable = true
163163

164164
[tool.datamodel-codegen.profiles.legacy]
165-
# Legacy profile for Pydantic v1
166-
output-model-type = "pydantic.BaseModel"
165+
# Legacy profile
166+
output-model-type = "pydantic_v2.BaseModel"
167167
```
168168

169169
Use profiles:

docs/dynamic-model-generation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ assert all(r is results[0] for r in results)
280280

281281
| Limitation | Details |
282282
|------------|---------|
283-
| Pydantic v2 only | Pydantic v1 is not supported |
283+
| Pydantic v2 only | Only Pydantic v2 is supported |
284284
| Not pickle-able | Use `model_dump()` to serialize instances |
285285
| Dict input only | Schema must be a `dict`, not a file path or string |
286286

@@ -292,7 +292,7 @@ assert all(r is results[0] for r in results)
292292
| Use case | Code generation, file output | Runtime validation |
293293
| Caching | No | Yes (configurable) |
294294
| Thread-safe | Yes | Yes |
295-
| Pydantic v1 | Yes | No |
295+
| Pydantic v2 | Yes | Yes |
296296

297297
## See Also
298298

docs/faq.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ See [Model Reuse and Deduplication](model-reuse.md) for details.
211211
### 🤷 Which output model type should I use?
212212

213213
- **Pydantic v2** (`pydantic_v2.BaseModel`): ✨ Recommended for new projects. Better performance and modern API.
214-
- **Pydantic v1** (`pydantic.BaseModel`): 🔄 Default for backward compatibility with existing codebases.
215214
- **dataclasses**: Simple data containers without validation.
216215
- **TypedDict**: Type hints for dict structures.
217216
- **msgspec**: High-performance serialization.
@@ -223,7 +222,7 @@ See [Output Model Types](what_is_the_difference_between_v1_and_v2.md) for a deta
223222
datamodel-codegen --output-model-type pydantic_v2.BaseModel ...
224223
```
225224

226-
See [Pydantic v1 vs v2](what_is_the_difference_between_v1_and_v2.md) for migration details.
225+
See [Output Model Types](what_is_the_difference_between_v1_and_v2.md) for more details.
227226

228227
📎 Related: [#803](https://github.com/koxudaxi/datamodel-code-generator/issues/803)
229228

@@ -237,9 +236,6 @@ python -c "import pydantic; print(pydantic.VERSION)"
237236
238237
# Generate for Pydantic v2
239238
datamodel-codegen --output-model-type pydantic_v2.BaseModel ...
240-
241-
# Generate for Pydantic v1
242-
datamodel-codegen --output-model-type pydantic.BaseModel ...
243239
```
244240

245241
---

docs/index.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/datamodel-code-generator)](https://pypi.python.org/pypi/datamodel-code-generator)
99
[![codecov](https://codecov.io/gh/koxudaxi/datamodel-code-generator/graph/badge.svg?token=plzSSFb9Li)](https://codecov.io/gh/koxudaxi/datamodel-code-generator)
1010
![license](https://img.shields.io/github/license/koxudaxi/datamodel-code-generator.svg)
11-
[![Pydantic v1](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v1.json)](https://pydantic.dev)
1211
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
1312

1413
---
@@ -17,7 +16,7 @@
1716

1817
- 📄 Converts **OpenAPI 3**, **JSON Schema**, **GraphQL**, and raw data (JSON/YAML/CSV) into Python models
1918
- 🐍 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
2120
- 🔗 Handles complex schemas: `$ref`, `allOf`, `oneOf`, `anyOf`, enums, and nested types
2221
- ✅ Produces type-safe, validated code ready for your IDE and type checker
2322

@@ -65,7 +64,6 @@
6564

6665
!!! warning "Omitting --output-model-type is deprecated"
6766
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.
6967

7068
We recommend using `--output-model-type pydantic_v2.BaseModel` for new projects.
7169

@@ -113,9 +111,6 @@ datamodel-codegen --input pet.json --input-file-type jsonschema --output-model-t
113111
# 🆕 Pydantic v2 (recommended for new projects)
114112
datamodel-codegen --output-model-type pydantic_v2.BaseModel ...
115113

116-
# 🔄 Pydantic v1 (default, for compatibility)
117-
datamodel-codegen --output-model-type pydantic.BaseModel ...
118-
119114
# 🏗️ Python dataclasses
120115
datamodel-codegen --output-model-type dataclasses.dataclass ...
121116

0 commit comments

Comments
 (0)