Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
Validación Pydantic JSON

Actualmente estoy trabajando en un proyecto de muestra usando pydantic y starlette. Este es el código del archivo principal:

 async def submit(request): response = await request.json() resume = Resume(**response) JsonResponse({"Hello":"World"})

Código del archivo de validación:

 class Basics(BaseModel): name: str label: str image: str email: str phone: str url: str summary: str location: Location profiles: List[Profiles] @validator('email') def email_validation(cls, v): regex = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[AZ|az]{2,}\b' if (re.fullmatch(regex, v)): return True else: raise ValueError("Email not valid")

Class Basics es una clase secundaria de la clase Currículum. Cuando la expresión regular no coincide, genera correctamente un error de valor y se muestra un error interno del servidor en cartero. Pero, ¿cómo devuelvo este error o alguna declaración al cartero y evito el error interno del servidor?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!