diff --git a/schemas/country.py b/schemas/country.py new file mode 100644 index 0000000..74b031e --- /dev/null +++ b/schemas/country.py @@ -0,0 +1,15 @@ +from pydantic import BaseModel, Field + +class CountryBase(BaseModel): + name: str = Field(..., max_length=100, description="Country name", example="United States") + code: str = Field(..., min_length=3, max_length=3, description="Country code", example="USA") + population: int = Field(..., gt=0, description="Country population", example=330000000) + + class Config: + orm_mode = True + +class CountryCreate(CountryBase): + pass + +class CountryResponse(CountryBase): + pass \ No newline at end of file