clean up and refactor

This commit is contained in:
Waylon Walker 2023-04-28 08:20:41 -05:00
parent cb95da6407
commit 22b7eaf593
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
16 changed files with 136 additions and 500 deletions

28
examples/models.py Normal file
View file

@ -0,0 +1,28 @@
from pydantic import BaseModel, Field
from typing import Optional
class Alpha(BaseModel):
a: int
class Color(BaseModel):
r: int
g: int
b: int
alpha: Alpha
class Hair(BaseModel):
color: Color
length: int
class Person(BaseModel):
name: str
other_name: Optional[str] = None
age: int
email: Optional[str]
pet: str = "dog"
address: str = Field("123 Main St", description="Where the person calls home.")
hair: Hair