feat: add validation for minimum length on various fields and update type definitions
This commit is contained in:
13
backend/app/schemas/common.py
Normal file
13
backend/app/schemas/common.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Annotated
|
||||
|
||||
from pydantic import StringConstraints
|
||||
from sqlmodel import SQLModel
|
||||
|
||||
# Reusable string type for request payloads where blank/whitespace-only values are invalid.
|
||||
NonEmptyStr = Annotated[str, StringConstraints(strip_whitespace=True, min_length=1)]
|
||||
|
||||
|
||||
class OkResponse(SQLModel):
|
||||
ok: bool = True
|
||||
Reference in New Issue
Block a user