from pydantic import BaseModel
class Request(BaseModel):
text: str
client_id: str
from pydantic import BaseModel, validator
class Request(BaseModel):
text: str
client_id: str
@validator('text')
def str_to_lower(cls, text: str):
return text.lower()
print(Request(text='Lower To Lower', client_id='Client'))
text='lower to lower' client_id='Client'