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

247
Views
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 answers
Answer question

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 Report
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!