StaffCoder
FastAPI
FastAPIFastAPI 0.139Python 3.13
7 modules · 28 challengesSign up
Modules7 modules · 28 challenges
Learn how FastAPI reads what a caller sends in the body: describing its shape as a model, giving optional parts sensible defaults, putting a rule on every field, refusing keys the model never declared, and nesting models inside each other so a mistake is reported at the exact place it happened.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Item Creation Model

Sign up to unlock
0%0 of 1 solvedeasy
About this challenge

This problem covers describing the shape of the data a caller may send when adding an item, so the parts they leave out get sensible values and the parts they get wrong are refused by name.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Field Constrained Order

Sign up to unlock
—No data yeteasy
About this challenge

This problem covers putting limits on each value an order carries, so a quantity, a price or a note outside what the business allows is refused before the order is ever placed.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Nested Shipment Structure

Sign up to unlock
—No data yeteasy
About this challenge

This problem covers describing data that has parts inside parts, an address and a list of parcels within one shipment, so a mistake anywhere is reported at the exact place it happened.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Booking Request Payload

STAR
Solving it completes the module
—No data yeteasy
About this challenge

This problem covers taking a booking that arrives split across the address, the query and a nested body, checking every part of it, and turning down anything that does not fit before the trip is even looked up.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.