Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

249
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda