What are FastAPI's two default interactive documentation UIs and URL paths?

This tests whether you know FastAPI's built-in auto-generated docs. A strong answer names Swagger UI at /docs and ReDoc at /redoc, then notes the OpenAPI schema at /openapi.json. A weak answer confuses these with external tools or custom routes.
WHAT THIS TESTS:
This question checks if you have hands-on experience with FastAPI beyond reading a README. It tests whether you know that FastAPI automatically generates interactive API documentation from your Python type hints and path operation definitions. The interviewer wants to see that you understand the framework ships with two distinct documentation interfaces by default and that you know where to find them.
A GOOD ANSWER COVERS:
A good answer hits four things in order. First, name Swagger UI as the first interactive documentation interface and state its default path is /docs. Second, name ReDoc as the alternative documentation interface and state its default path is /redoc. Third, mention that both are generated from the OpenAPI schema which is automatically available at /openapi.json. Fourth, note that these are enabled by default with zero configuration and are derived from your route definitions, Pydantic models, and type annotations.
COMMON WRONG ANSWERS:
A red flag is confusing Swagger UI with external tools like Postman or Insomnia. Another red flag is saying the docs are at custom paths like /api/docs without clarifying those are configurable overrides. Some candidates mention only one UI or mix up the names and paths. Saying you disabled them in production without explaining why or how is also a warning sign unless the role specifically requires that hardening.
LIKELY FOLLOW-UPS:
An interviewer might ask how to disable or customize the documentation URLs. They might ask what information the OpenAPI schema contains. They could ask how to add authentication to the docs or how to self-host the Swagger UI static assets. Another common follow-up is asking how these auto-generated docs improve API consistency across a team.
ONE CONCRETE EXAMPLE:
If you create a FastAPI app with a single GET endpoint at /items/{item_id} that returns an Item Pydantic model, you can start the server and navigate to http://localhost:8000/docs to see Swagger UI with a Try It Out button. You can also visit http://localhost:8000/redoc to see the same API presented in ReDoc's three-panel layout. Both read from http://localhost:8000/openapi.json, which contains the full OpenAPI specification including your path parameters, response models, and validation constraints.
Source: fastapi.tiangolo.com
Read the original → fastapi.tiangolo.com
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.