Skip to content

Commit 01c2f41

Browse files
feat: remove pydantic v1 output support (#3031)
* feat: remove pydantic v1 output support * docs: update CLI reference documentation and prompt data 🤖 Generated by GitHub Actions * docs: update llms.txt files Generated by GitHub Actions * test: drop v1 output baselines after restack * docs: clarify generated cli reference examples * docs: update llms.txt files Generated by GitHub Actions * refactor: remove dead util compatibility helpers * refactor: remove dead coverage exemptions * refactor: remove unused UnionIntFloat string conversion * docs: reuse standard golden for title-as-name cli docs --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent cd3569b commit 01c2f41

50 files changed

Lines changed: 1328 additions & 4089 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/cli-reference/base-options.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,8 @@ instead of generating duplicate classes from external schema files.
134134

135135
from __future__ import annotations
136136

137-
from datetime import datetime
138-
139137
from mypackage.shared.models import Error, User
140-
from pydantic import BaseModel
138+
from pydantic import AwareDatetime, BaseModel
141139

142140

143141
class UserResponse(BaseModel):
@@ -147,7 +145,7 @@ instead of generating duplicate classes from external schema files.
147145

148146
class ErrorResponse(BaseModel):
149147
error: Error
150-
timestamp: datetime
148+
timestamp: AwareDatetime
151149
```
152150

153151
---
@@ -257,7 +255,7 @@ not `--input-file-type yaml`. The `yaml` type treats the file as raw data and in
257255
258256
from __future__ import annotations
259257
260-
from pydantic import BaseModel
258+
from pydantic import BaseModel, Field
261259
262260
263261
class Pet(BaseModel):
@@ -266,7 +264,7 @@ not `--input-file-type yaml`. The `yaml` type treats the file as raw data and in
266264
267265
268266
class Model(BaseModel):
269-
Pet: Pet
267+
Pet_1: Pet = Field(..., alias='Pet')
270268
```
271269

272270
=== "YAML"
@@ -288,7 +286,7 @@ not `--input-file-type yaml`. The `yaml` type treats the file as raw data and in
288286
289287
from __future__ import annotations
290288
291-
from pydantic import BaseModel
289+
from pydantic import BaseModel, Field
292290
293291
294292
class Pet(BaseModel):
@@ -297,7 +295,7 @@ not `--input-file-type yaml`. The `yaml` type treats the file as raw data and in
297295
298296
299297
class Model(BaseModel):
300-
Pet: Pet
298+
Pet_1: Pet = Field(..., alias='Pet')
301299
```
302300

303301
---

0 commit comments

Comments
 (0)