35 lines
527 B
Python
35 lines
527 B
Python
from pydantic import BaseModel, Field, HttpUrl
|
|
|
|
|
|
class PersonBase(BaseModel):
|
|
"""
|
|
Base schema for a person
|
|
"""
|
|
firstName: str
|
|
lastName: str
|
|
linkedinUrl: str
|
|
|
|
|
|
class PersonCreate(PersonBase):
|
|
"""
|
|
Schema for creating a new person
|
|
"""
|
|
pass
|
|
|
|
|
|
class PersonInDBBase(PersonBase):
|
|
"""
|
|
Base schema for a person in the database
|
|
"""
|
|
id: str
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class Person(PersonInDBBase):
|
|
"""
|
|
Schema for returning a person
|
|
"""
|
|
pass
|