Files
fastapi/tests/test_pydantic_v1_v2_multifile/modelsv2.py
Sebastián Ramírez d34918abf0 Add support for from pydantic.v1 import BaseModel, mixed Pydantic v1 and v2 models in the same app (#14168)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-11 18:45:54 +02:00

20 lines
321 B
Python

from typing import List, Union
from pydantic import BaseModel
class SubItem(BaseModel):
new_sub_name: str
class Item(BaseModel):
new_title: str
new_size: int
new_description: Union[str, None] = None
new_sub: SubItem
new_multi: List[SubItem] = []
class ItemInList(BaseModel):
name2: str