Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

248
Vistas
Set required form fields using FastAPI

I am building an application in FastAPI and need to receive form fields (x-www-form-urlencoded). I used this page to figure out what to do, And I found I had to use the class: Form(...). The problem is that I want to set the fields as required (to appear in the documentation as required, and also that if they are missing the app will return 422). Form has one required argument, which is: default, but once the default is set the field is no required. I tried to write: Form(None), but it did not help. Is there a way to solve the problem? Many thanks in advance.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Any parameter defined as Form(...) (including the three dots) in your view signature will be required by default. Make sure that you actually include the three dots - they do have a purpose.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda